I Figured it out 🙂
<?php
$posts = get_field('related_controllers');
if( $posts ): ?>
<?php
$count = 0;
foreach( $posts as $p ): // variable must NOT be called $post (IMPORTANT) ?>
<li <?php
if ($count == 0) {
echo 'class="active"';
}
?>>
<a href="#<?php echo $p->ID; ?>" data-toggle="tab"><?php echo get_the_title( $p->ID ); ?></a>
</li>
<?php
$count++;
endforeach; ?>
<?php endif; ?>