How do get post thumbnail into plugin?

I dont know where you are using/inserting this code, but maybe you need the current post ID. Try using get_the_post_thumbnail_url( <post-ID> ,<thumbnail-size> );
To get the ID of the current post you can for example use $current_id = get_the_ID();. Than you can try $src = get_the_post_thumbnail_url( $current_id ,'post-thumbnail' ); to get the URL.