to get the url of any post or page in wordpress first you need to get the id of that page or post, and for that go to admin panel and open the post or page for edit and on url you will find ?post=<post id> and get the post or page id from there.
Now Keep the page or post id in a veriable
$post_id = 40;
Then call the function get_page_link() and pass the post id through the function and print it and you will get the id
Now here is the full code
<?php $post_id = 40; ?> <?php echo get_page_link($post_id ); ?>
Thanks for Reading