Translation:My head hurts.
Read back to HadiAljish's answer above: The ん (or の) implies that this sentence is an explanation for something: eg "It's just that my head hurts."
ん is more casual than の, so the sentence could easily be あたまがいたいのです and mean the same thing, just sounding a little more formal.
Going to share a link that a mod posted on the discussion thread from another question in this set: https://www.wasabi-jpn.com/japanese-grammar/explanatory-noda/
Explains the common usages of ん in this context. Explanation / Reason is the main usage, but there are a few others.