This is all you need:
{% set linkedEntry = craft.entries.id(42).first() %}
<a href="{{ linkedEntry.url }}">{{ linkedEntry.title }}</a>
If you use this in many places you can also make a macro.
{% macro linkToEntry(entryId) %}
{# Get the entry with the selected ID #}
{% set linkedEntry = craft.entries.id(entryId).first() %}
{# Make sure the entry exists and output the link #}
{% if linkedEntry %}
<a href="{{ linkedEntry.url }}">{{ linkedEntry.title }}</a>
{% endif %}
{% endmacro %}
It's nice to have macros in a separate file and import it into your templates. I really love using macros for this kind of code snippets, very useful and DRY.
{% import "macros.html" as macros %}
<li>{{ macros.linkToEntry(42) }}</li>
<li>{{ macros.linkToEntry(17) }}</li>
<li>{{ macros.linkToEntry(20) }}</li>