The register_taxonomy function is used to create a new type of category in WordPress and associate it to a post type. It has three parameters:
register_taxonomy( $taxonomy_name, $post_type, $options );
The first argument is a unique identifier for the taxonomy. The second parameter is the post type that it should be associated with, which should match the type declared with the register_post_type function. The third argument is an array of parameters that determine how the new taxonomy will behave.
In this example, we have set a few taxonomy options, including a first item called labels that contains an array of text strings that will be used in the interface when referring to the new taxonomy. We also specified a second element, called show_ui, which controls the display of the taxonomy meta box in the post editor and the presence of a link to access the taxonomy editor in the administration menu. Next is an option called show_tagcloud, which we set to false to avoid displaying a tag cloud of all taxonomy values. Finally, the last item in the options array is called hierarchical. When set to true, taxonomy items will be able to have parent/child relationships and will be accessible as a list of checkboxes in the post editor. If set to false, all taxonomies are organized as a flat list and can be selected using an interface similar to the tag window in the post and page editor.
There are many more options available for the register_taxonomy function, as can be seen if you visit the WordPress Codex website (https://codex.wordpress.org/Function_Reference/register_taxonomy), but the ones found here are the essential ones to define a basic taxonomy.