implementing my wp_query using $wpdb class

You haven’t mentioned what you want from this request and what is it for. You should clarify that to get the most accurate answer.

Anyway, if you want to write a pure SQL request you can’t use WP_Query but need to use $wpdb->get_results instead, as mentionned by @hadimahoor. Here is a request to get a list of all doctors with their location.

global $wpdb;

// Pure SQL
$sql = $wpdb->prepare("SELECT p.ID, post_title as doctor, p2.ID as location_id, p2.post_title as location
    FROM {$wpdb->prefix}posts p
    INNER JOIN {$wpdb->prefix}postmeta m ON m.post_id = p.ID AND m.meta_key = 'location'
    INNER JOIN {$wpdb->prefix}posts p2 ON p2.ID = m.meta_value
    WHERE p.post_status="publish" AND ...");
$doctors = $wpdb->get_results($sql);

And here is the simplest solution to get the doctors list by location :

// Get doctors by location
$doctors = get_posts([
    'post_type' => 'doctors',
    'meta_key' => 'location',
    'meta_value' => $location_id
]);