How to filter custom taxonomy categories on archive?

Recap: You created a custom post type = “downloads” and a custom taxonomy = “downloads_category” with a rewrite to “categoria-de-downloads”

First: The “is_tax” at the head of your archive.php is failing because the name of your custom taxonomy should be “downloads_category“; it must be spelt with an underline rather than a hyphen (Codex).
You also need to change this in:

  1. register_taxonomy“: the name of your custom taxonomy,

  2. register_post_type“: the ‘taxonomies’ line,

  3. tax_query“: the ‘taxonomy’ line.

Second: as noted by SallyCJ, ‘tax query‘ requires a ‘terms’ parameter.

For example: let’s say that you create two terms for your custom taxonomy – ‘Type01′ and “Type02’ and that the slugs for those would be type01 and type02. The elements of code in your query would be like this:

    array(
        'taxonomy' => 'downloads_category',
        'field'    => 'slug',
        'terms'    => array( 'type01', 'type02' ),
  )

Third: you need some code to actually collect the slugs. Here’s my suggestion

// get all the terms for this custom taxonomy
        $myterms = get_terms( array(
                'taxonomy' => 'downloads_category',
                'hide_empty' => false,
        ) );    
        //echo "the terms are <pre>";print_r($myterms);echo "</pre>"; //DEBUG

        //create a simple array to store the terms for use in a query
        $termsarray = []; 
        // get the slugs only
        $termsarray = wp_list_pluck( $myterms, 'slug' );
        //echo "terms array is <pre>";print_r($termsarray);echo "</pre>"; //DEBUG

Fourth: you need to insert the slugs into the query. This code has been tested and works. Of course, the variable $termsarray in this code is the same variable as in the previous note.

// build a new query to get all the posts for the custom taxonomy
        $myargs = array(
                'post_type' => 'downloads',
                'tax_query' => array(
                        array(
                                'taxonomy' => 'downloads_category',
                                'field' => 'slug',
                                'terms' => $termsarray,
                        )
                )
        );

Fifth: I suggest an alternative to using archive.php. Instead create a taxonomy file for your custom taxonomy. I created a “taxonomy-categoria-de-downloads.php” from a copy of archive.php. It works just fine and lets you format the output for your custom taxonomy without having to make the archive template more complicated.

At times like this, it’s important to have a firm grasp on which templates are called in certain situations. The Codex Template Hierarchy is essential and “Visualize The WordPress Template Hierarchy” is very highly recommended.

Sixth: In an earlier version of this answer, I outlined the files to display the custom post itself, with the terms highlighted. On refection, the question doesn’t mention this at all, and I have removed it as irrelevant. If the OP would like to see it, I can easily re-post.