You have to use the ACF API
get_field() function requires the name of the field. If you are using the loop then that's all you need. If you are outside the loop you will need to provide the post ID as the second argument. The final, optional argument is boolean and determines whether formatting is applied to the data, this defaults to true so if you don't want formatting you need to provide a false here.
$val = get_field('frequency', $postID, false);
'frequency' is the name of the custom field you desire.
Since this method only requires that you are either in the loop or that you know the post ID you can use in any of the WordPress database methods that are available to you.