Using WordPress Database API in plugin

In requirements to WP Plugin there is text - “Direct database access is prohibited. Instead, make use of the WordPress Database API.”

I am writing a plugin. It creates 2 tables in the database that will store data related to this plugin. Also, the plugin will receive data from standard WordPress database tables.
I imagine how to get data from standard tables using WP API (you will need to use WP_Query ()). But I don’t know how to get data from custom tables using WP_Query(). Am i need to use something else?

Or does the statement “Direct database access is prohibited. Instead, make use of the WordPress Database API.” refer only to data obtained from standard WordPress tables?

Thanks for your answer.
If wpdb is used, then it is considered that this is not direct database access?
My plugin was written using wpdb and only then did I see the requirement to use of the WordPress Database API.
I thought that this requirement means that you need to use routes and get data through WP_Query ().

So i can use wpdb to access the database and not necessarily use routes?

You shouldn’t get the data from the database by using SQL but you can use wpdb to manage the data.

Thanks for your answer.
Can I use this entry in the plugin:
global $wpdb;
$results = $wpdb->get_results( “SELECT * FROM {$wpdb->prefix}options WHERE option_id = 1”, OBJECT );
and it is considered that it does not use SQL request?

Sure, as long as you use wpdb.