In Drupal 7 there was a module name hierarchical select to achieve this. But it is no longer support for Drupal 8. Is there another way to add this to a content type, so a user can select an element from this taxonomy. I need that to be hierarchical.
Simple hierarchical select
Simple hierarchical select defines a new form widget for taxonomy fields to select a term by "browsing" through the vocabularies hierarchy. The widget is available in node forms and as Views exposed filter.
This module has been inspired by Hierarchical select but is much simpler (hence the name ;) ).
Client-side hierarchical select
A simple client-side hierarchical select widget for taxonomy terms.
The widget provides three settings:
Force selection of deepest level (If checked the user will be forced to select terms from the deepest level.)
Parent (Allows to select a parent term to use only a subtree of a vocabulary for this field.)
Labels per hierarchy-level