Iterate through multiple value content field in Twig template
Agree with 4k4 the field template is the best place, if you really want it in the entity template (e.g. node) you can do something like this:

{% for key, item in content.field_tags if key|first != '#' %}
  &lt;div class="item-{{ key + 1 }}"&gt;{{ item }}&lt;/div&gt;
{% endfor %}


But honestly I think it's a bit ugly, the field template is the right place.