I use a hard handgun case that has holes for 2 padlocks.
If you don't have one, look at the box your gun came in and see if it has holes you can use for the lock(s).
I put the ammo back in the box (or two) and mags in the mag pouch. (there can be loaded mags in the mag pouch but I usually put the ammo in the box)
All go in the hard case then padlocks go on.
(**on edit**: It doesn't HAVE to go in the locked hard case. Inside the suitcase is fine if you don't have enough room for ammo.) That goes in the suitcase. On the suitcase I just use a cheap TSA 'approved' lock that is a POS.
Tell the ticket agent that you have a firearm to declare and they will give you the tag to sign, that goes in the suitcase that has the gun in it. No big deal.
In Phx, they tell you to hang out for a few minutes while the bag gets x-rayed in case the TSA geek needs you to open it.
In Seattle, they send you over to a separate area and that guy swabs the bag inside and out but doesn't check inside the locked case. No, it doesn't make any sense to me either.
Then head to the bar and get a bloody mary.

Check the airline regs 'cause they
can be different than the TSA regs, but usually aren't.