Correct way to change gamemodes

Since I can’t use search and I can’t find it on google, what can I put in the console command line to change the gamemode. It seems sv_defaultgamemode is depreciated because it doesn’t seem to work for me anymore.

Edit: Never mind, I’m dumb, search is working now.