You're probably trying to run Hammer through Source SDK. Don't do that, open Hammer from your Team Fortress 2/bin/ folder instead, and preferably make a shortcut to it for easier access later.
If this is your first time logging in after the migration (Feb 8, 2022), you must reset your password to log in. Follow this guide if you're having trouble