custom post type – project link output via single-portfolio.php

You can always use WordPress Code Reference to understand what is going on:

get_post_custom() is a function that retrieves post meta fields and needs a post id as an parameter. It returns an array with post meta for the given post:
https://developer.wordpress.org/reference/functions/get_post_custom/

get_post_custom_values() is a function that retrieves values for a custom post field and accepts the key and the post id as parameters. It returns an array of meta field values.
https://developer.wordpress.org/reference/functions/get_post_custom_values/

So you need the indexes to access the first position in the arrays. If you want to take a look at the the indexes of the array, you can output them like:

$key_values = get_post_custom_values( 'project-link' );

echo $key_values[0];

This will show you what the array contains on index position 0. Try it with 1 or 2, if you want to see whats inside of these index positions.


The other question was, how you get the desired output. First of all you want to show the url, so you have to put it between the a tags:

<a href="https://wordpress.stackexchange.com/questions/366797/<?php echo $link[0]; ?>" target="_blank"><?php echo $link[0]; ?></a>

And if you want to put it below your content, you need to put your the_content() call above the a tag. Also I guess you should use it inside your post loop and use the function get_post_custom_values with the post id:

<main class="view">
    <?php
        while ( have_posts() ) :the_post();
            the_content();
            $current_post = get_the_ID();
            $link= get_post_custom_values('project-link', $current_post); 
            if($link[0] != "") { ?>
                <a href="https://wordpress.stackexchange.com/questions/366797/<?php echo $link[0]; ?>" target="_blank"><?php echo $link[0]; ?></a>
            <?php } else { ?>
                <em>live link unavailable</em>
            <?php }
        endwhile;
    ?>
</main><!-- .site-main -->

Hope this helps and I understood your question correctly.