Q:

Getting the post-id of another post by using meta-key in Wordpress

Question: How can I access the post-id from another post using get_post_meta()?
Hello, I am currently working on a Wordpress website, on this website I want to access the post-id from another post, I am planning to use the get_post_meta() array but I am not sure how to use it. I am unsure where to find $key and how to use it? 
This is my code so far...
Post 1 (The post where I want to "echo" the post-id).
<?php
     $educator_meta= get_post_meta(get_the_id(), 'educator_id');
?>
<html>
      <div class="container">
             <?php 
                  echo "This is the post-id of the educator post: ", $educator_meta[0];
                  echo "This is the current posts post-id: ", get_the_ID();
             ?>
       </div>
</html>

Post 2 (The page which I want to get the post-id from).
    <?php
$current_educator_id = get_the_id();
$course_lessons = new WP_Query( array(
    'post_type'     => 'educator',
    'order'           => 'asc',
    'posts_per_page' => -1,
    'meta_query' => array(
        array(
            'key'     => 'educator_id',
            'value'   => $current_educator_id,
            'compare' => 'IN',
        ),
    ),
) );?>

A:

If you know the title or slug, you can use other maybe easier methods.
$post = get_page_by_title( 'Your post title', OBJECT, 'post' );
$post_id = $post->ID;

If you know the URL, you can use this as well : 
$url = "whatever-url-to-post-here";
$postid = url_to_postid( $url );

Both will return the ID for you - the first method gives you the entire object, so you can get everything from it.
Check it out by var_dump($post);
EDIT : if you really want to use post meta keys you can see the all by doing this : 
highlight_string("<?php\n\$data =\n" . var_export(get_post_meta(get_the_id()), true) . ";\n?>");

This will provide an easy-to-read overview of all the meta keys.

