What hreflang does
Hreflang tags tell Google which language or region each version of a page is for, so searchers see the right one. They're written as <link rel="alternate" hreflang="de" href="…"> in the page's head (or in the sitemap).
The rules that trip people up
Each version must list all the others and itself. Every alternate page must link back (return links), or Google ignores the pair. Codes use ISO language codes like "en" or "de", optionally with a region like "en-GB"; "en-UK" is wrong. Add an x-default for visitors who match no version.