pick (someone or something) out of a hat
To select someone or something entirely at random. I don't understand why our company is being targeted. It's as if the IRS picked us out of a hat to scrutinize! It doesn't really matter who gets promoted to assistant manager—just pick a name out of a hat for all I care!
pick, etc. something out of a hat
(informal) choose somebody/something completely by chance: We couldn’t decide where to go on holiday so we just picked a place out of a hat.