Let's say we want to change main loop, only for specific taxonomy, or post type.
Targeting only main loop on book post type archive page.
add_action( 'pre_get_posts', 'my_callback_function' );
function my_callback_function( $query ) {
if( !$query->is_main_query() || is_admin() ) return;...