{ Twig Link Routing }

For handling both internal and external links from a Link field and aliasing internal paths.

Assuming Link field machine name of field_primary_button:

{% if paragraph.field_primary_button is not empty %}
    {% set primary_link = '' %}

    {# Translate internal paths for links. Otherwise they are not routed e.g. entity:node/10 #}
    {% if content.field_primary_button['#items'] %}
       {% if content.field_primary_button['#items'].0.url.external %}
          {% set primary_link = content.field_primary_button['#items'].0.url %}
       {% else %}
          {% set primary_link = path(content.field_primary_button['#items'].0.url.routeName, content.field_primary_button['#items'].0.url.routeParameters) %}
       {% endif %}
    {% endif %}

    <div>
       <a class="btn" href="{{ primary_link }}">{{ content.field_primary_button['#items'].0.title }}</a>
    </div>
{% endif %}