Show post only if match all categories

Here’s an updated version of your code that will get posts that have the Post Format Video and that have the same Categories as the current post in the loop.

You’ll call wpse_get_video_posts_with_matching_categories() to execute the function.

function wpse_get_video_posts_with_matching_categories() {
    $categories = get_the_category( get_the_ID() );

    if ( empty ( $categories ) ) {
        return;
    }

    $my_query = new WP_Query( [
        'post__not_in'   => [ get_the_ID() ],
        'posts_per_page' => 30,
        'tax_query'      => [
            'relation' => 'AND', // We will check BOTH of the following criteria.
            [
                'taxonomy' => 'post_format',
                'field'    => 'slug',
                'terms'    => [ 'post-format-video' ],
                'operator' => 'IN',
            ],
            [
                'taxonomy' => 'category',
                'field'    => 'term_id',
                'terms'    => wp_list_pluck( $categories, 'term_id' ), // A handy way to extract data.
                'operator' => 'AND',
            ],
        ],
    ] );
    ?>

    <?php if ( $my_query->have_posts() ) : ?>

    <div class="sidebar">
        <?php while( $my_query->have_posts() ) : ?>
            <?php
                $my_query->the_post();
                // Output content...
                the_title( '<h3>', '</h3>' );
            ?>
        <?php endwhile; ?>
    </div>
    <?php wp_reset_postdata(); ?>
    <?php endif; ?>
    <?php
}

I tested this and I think it’s what you’re after. Note that your original code is missing the part where we query against the term IDs. I also spruced things up a bit with some best practices.