How to apply pre_get_posts on custom post_type in WordPress?

I have a custom post_type where users can vote for each post and I want to order them by voting. I can reorder the post by meta_value_num in pre_get_posts. But the problem is when I try to do that the default post gets affected. How do I prevent pre_get_posts filter WordPress default posts?

Basically, I want to know how can I check if current query is for that custom post_type.
For example, I can write conditions like the below.

if( $query->is_home() && $query->is_main_query() ){
    // Code goes here
}

How can I check custom post_type?

There are several ways to check post_type in pre_get_posts.
You can do

if( $query->is_post_type( 'custom_post_type' ) ){
    // do something
}

Or you can use this as well.

if( is_post_type_archive('custom_post_type') ){
    // do something
}

Or

if( $query->get( 'post_type' ) === 'custom_post_type' ){
    // do something
}