Flying with a pistol really, really easy.
Any locked hardsided case, combination or key. You are the only one that needs to be able to open the case. Even a plastic box/case that many pistols come in will work if it has slots for padlocks or if you can wrap a gun cable lock around the handle so tightly that the case cannot be opened. Or you can buy a case specifically for this if you like.
Go to the airline counter where you check your bags (not curbside) and tell them you have an unloaded firearm to declare. You fill out/sign a brief card, they place the card in the piece of luggage that contains the case with the gun (or in the case itself if you have, say, a rifle in its own case), then you go to oversize baggage (instead of the luggage going on the belt). TSA checks it at oversize baggage and off you go. Simple and almost always quick and easy.
You can have ammunition in the same locked case as the gun, if you want. I don't think there is a TSA limit to the ammo but most airlines have an 11 pound limit (that's a lot of ammo unless you are taking a class on the other end and want to bring ammo or something lol). Ammo is best in original factory boxes but I always have at least one loaded magazine, sometimes a few, and have never had an issue. The TSA requirements for ammo storage are somewhat vague.