There are a lot of hats and headwear to acquire. Some are obtained through your inbox so make sure to take care of that on your phone after beating the game. Most are acquired through completing the tasks. Here's a list of the trickier ones with a complete scroll through of all the hats at the end to see what you're missing.
BIG TIP: For those having trouble with the hat achievement, if you decide to do a new playthrough or for those reading this that haven't started yet. DO NOT open your inbox at all until everything else is complete. All your mail with the hats will be there at the very end, I've had a few people confirm this worked for them on their 2nd playthrough and as shown in the video that is how I unlocked mine on both Steam & Xbox.
Also it's being noted in the comments by a few players that if you skip the credits you won't receive the rewards for beating the game so make sure to let them roll.
HatsRobo Rafael Shop – Robo Roids Merch
Mushroom Hats – Complete Kill & Brutalize Tasks for the Shroominati Shadows NPCs
5:12 – Graffiti Hat
6:45 – Electrician’s Hat
7:00 – Artist Hat
11:18 – Acorn Cap
24:50 – Goblin Ears
29:08 – Fancy Glasses
29:30 – Fox Hat
33:05 - Mailbox Hat (check inbox after)
39:54 – Rubber Duck
41:05 – Turnip Girl’s Bow
46:00 – Rat Hat
47:40 - Don's Fedora
51:50 – Explorer’s Hat (give Annie all Photos)
53:08 – Golden Sh!% (return all rocks to Pie)
53:57 – Accept all hats from your inbox
55:45 – Scroll through complete hat list
Dillitini's Fedora - Beat the game (check inbox after)
Alien Glasses - Beat the game (check inbox after)
Legally Distinct Space Visor - Start final boss sequence (check inbox after)
Photos5:22 – Fancy Foyer Photo
17:50 – Failed Festival Photo
19:50 – Crangelica Photo
20:10 – Cryptid Photo
21:15 – Dark Dock Photo 1
21:35 – Dark Dock Photo 2
31:36 – Cryptic Crypt Photo
33:50 – Cryptic Crypt Photo 2
38:00 – Soupy Sewers Photo
43:50 – Put a Ring on it Photo
47:40 – Mysterious Motherlode Photo
NOTE: This appears to be bugged for some where certain hats don't unlock upon meeting the necessary requirements. Wish I could help but your best option is probably to head to the Snoozy Kazoo Discord and check there or post in their support thread.