When a singular countable object is introduced without prior reference, English uses 'a' rather than 'the'. The adjective 'new' sits before 'hat', giving 'a new hat'.
- a new hat is correct because it supplies the indefinite article and correct adjective-noun order.
- new hat leaves the countable noun without any article.
- a hat new places the adjective after the noun, which English does not allow here.
- in new hat wrongly turns the object into a prepositional phrase and still omits the article.
So 'a new hat' is the right replacement.