What is the right way to code links for WordPress pages?

For general links use home_url().

<a href="https://wordpress.stackexchange.com/questions/55146/<?php echo esc_url( home_url("/path/to/link' ) );?>">Anchor</a>

To link to theme assets like images etc use get_stylesheet_directory_uri().

<img src="https://wordpress.stackexchange.com/questions/55146/<?php echo get_stylesheet_directory_uri(); ?>/images/your_image.png" />

You could just as easily use relative links for navigation but I would stick with home_url() for consistency.