You should be able to query ACF fields in the same way you query normal custom fields. With that in mind, you can do a simple meta_query
to get a list of posts from the selected field
You can try the following:
$args = array(
'post_type' => 'products',
'meta_query' => array(
array(
'key' => 'stock',
'value' => '1',
'compare' => 'IN',
),
),
);
$query = new WP_Query( $args );
EDIT
From comments, the correct value for the value
parameter in the meta_query
should be 1
, not true