How to send get request to file.php right and where to store that file.php?

This is not recommended, but if you want to do it, do it this way:

Save your file in your WordPress’s root folder, right next to index.php. Then, require WordPress’s core files in it, by this code:

define('WP_USE_THEMES', false);
global $wp, $wp_query, $wp_the_query, $wp_rewrite, $wp_did_header;
require('wp-load.php');

Now, even though the file is not actually a part of WordPress, it can be treated as one, and you can do anything you want with it.

However this might cause security issues, so i recommend you only try it for educational purposes.

To communicate with WordPress using AJAX, use Rest-API instead. You can find an easy solution in this answer.