Can’t get “has_sub_field()” to work in a conditional [closed]

You need to use the has_sub_field() method inside an if() statement. I’ve only included the affected code below to highlight the specific changes required.

if (has_sub_field('vimeo_id')): // Added if()
    // ...
endif;

You also need to a use the get_sub_field() function here as opposed to the has_sub_field() function:

<iframe src="https://player.vimeo.com/video/<?php echo get_sub_field('vimeo_id'); ?>"></iframe>