Elementor custom query

This just requires adding additional parameters to the query->set() array… …it’s standard WP_Query() stuff. So you’d essentially be taking this line:

$query->set( 'post_type', [ 'libri', 'post'] );

…and expanding it to include a tax query…

$tax_query = array(
    'relation' => 'OR',  //can also use 'AND' depends how you want it to work 
    array(
        'taxonomy' => 'category',
        'field' => 'id',
        'terms' => 1 //put your term id here
    ),
    array(
        'taxonomy' => 'category',
        'field' => 'id',
        'terms' => 2 //put your term id here
    ),
    array(
        'taxonomy' => 'category',
        'field' => 'id',
        'terms' => 3 //put your term id here
    )
);
$query->set( 
     'post_type', [ 'libri', 'post'],
     'tax_query', $tax_query
);