Exclude trash from save_post

save_post gets fired, once the post is saved. We get the current post object as the second parameter. So we can check, if the current post status is trash:

<?php
add_action( 'save_post', function( $post_ID, $post, $update ) {
    if ( 'trash' === $post->post_status ) {
        return;
    }

    /** do your stuff **/
}, 10, 3 );
?>