What does hreflang do?
In HTML, hreflang states the language of a linked resource. MDN describes it as purely advisory and says its value should be a valid BCP 47 language tag [2]. Google uses it to recognise that several pages are language or regional variants of the same content, so it can show each user the most suitable one [1]. One caveat from Google: it works out a page's language from the content itself, not from hreflang or the HTML lang attribute [1].
How is it written?
Google treats three methods as equal: link rel="alternate" elements in the head, a Link header in the HTTP response, or xhtml:link entries under each URL in an XML sitemap. Pick one; using all three adds maintenance without any benefit [1]. The language code follows ISO 639-1 (such as de), and an optional region code follows ISO 3166-1 Alpha 2, joined with a hyphen (en-GB). A region code cannot stand on its own [1].
What is the most common mistake?
Missing return links. Every version has to list itself and every other version; if page A points to page B but B does not point back, Google may ignore the annotations [1]. URLs must be fully qualified, protocol included [1].
A concrete case: an article published in Turkish and English lists both the tr and en versions in the head of each page. For visitors whose language matches neither, an x-default value points to a generic page such as a language picker [1].