The hreflang attribute tells search engines which language or regional version of a page should be shown to each audience. If you have the same content in Portuguese, English and Spanish, hreflang prevents Google from showing the wrong version to the wrong user.
Implementation requires each page to declare all of its alternate versions, including itself. For example, a Portuguese page would declare: hreflang="pt-BR" for itself, hreflang="en" for the English version and hreflang="es" for the Spanish one. It is reciprocal: each version must declare all the others.
Hreflang mistakes are common and can hurt international SEO. The most frequent ones are: non-reciprocal declarations (A points to B but B does not point back to A), incorrect language codes and a missing x-default attribute for the default version. Validate with Google Search Console and the hreflang.org tool.