To output a new line in HTML you need to use HTML's representation of a new line which is <br/>
php has a function for you that converts all natural new lines to HTML new lines > nl2br()
Then your code should look like
<?php
$foo = 'bar';
echo nl2br("Hello \n $foo!");
?>