There are a couple of reliable ways to pick up a no-cost hat.
Roblox has historically given away seasonal accessories around Christmas, so logging in during the holidays is worth a look. The other route is account verification: enter your email address when prompted during sign-up, finish creating the account, and Roblox sends a confirmation message that credits the new account with a free hat.