Dynamic next and previous post links

1) As you need to hide next or prev link you should output both.

2) Then create some meta field in posts. I usually use ACF for it, it is pretty easy. Create 2 custom fields, text input fields for every post, let’s say:
“Next button URL” and “Prev button URL”

3) And in post.php wrap “previous” and “next” buttons created in #1 with if condition, for example:

if($nextcustomfield){
    echo '<a href="'.$nextcustomfield.'">NEXT</a>';
}else{
    NORMAL NEXT LINK CODE
}