Show Custom Post Type based on Category on Archive Page

Right now you are looping the default WP_Query. Better to define the exact query to fetch the exact posts you want.
Here is a link to the complete guide of how to use it, and how to use taxonomies:
https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parameters