For IPA and pale ale, before racking finished beer from fermenter buckets into kegs via an auto-siphon, I just lower an open-ended sanitized gas line from a spare 5-lb co2 tank with gauge, down towards the bottom of the sanitized empty receiving keg and gently/slowly add co2 gas until it blows out a lighter (the long one used to light a BBQ grill) held above the keg opening. That is, once co2 displaces all of the oxygen from the keg the outgoing co2 blows out the lighter. Then I add a keg lid until I'm ready to rack in the beer. co2 is heavier than o2 so the co2 stays in there during racking.
Then I add keg hops in a sanitized fine-mesh nylon hop bag, cinched and knotted closed, and tied into the hole in the welded tab on the underside of a keg lid. I buy these manufactured - a bit spendy but most people only need one, a couple, or a few of them.
After the beer is racked into the keg, I lower the hops-filled bag (normally a 9" x 12" bag holding 3 oz pellet hops) that is tied off to the lid, and secure the keg lid.
Then I immediately purge the keg head space as follows: 1) attach co2 gas to "in" poppet via QD, 2) fill head space with co2 at ~12 psi, 3) turn off gas, 4) displace all gas/air in headspace via pressure release valve, 5) repeat for a total of 10 times, 6) begin to carbonate the beer in my kegerator.