Breakdown of Höfuðverkurinn versnar þegar ég sef illa.
Questions & Answers about Höfuðverkurinn versnar þegar ég sef illa.
Because Icelandic usually puts the definite article on the end of the noun.
So the sentence literally says The headache gets worse when I sleep badly.
If the English meaning you were shown uses my headache, that is coming from context, not from the Icelandic grammar itself. To say my headache explicitly, you would normally say höfuðverkurinn minn.