There isn't a trick - there are lots of little techniques people might use, or don't by personal preference.
Start by putting the shifter into the highest/hardest gear, which is the chain on the smallest tooth-count sprocket.
Personally I keep the bike upright - my only disk-brake bike can't go upside down because its a recumbent.
Then I have the rear wheel to hand, leaning against my right leg while I stand on the left of the bike, facing rear/right across the dropouts.
I lift the rear of the bike using two hands, and then use my right hand to grab the wheel and feed it between the stays. I juggle around and use the right hand to "extend" the rear derailleur to allow the cassette to slip into the chain. Often the bike will rest the underside of the stays on the QR. That's OK.
I then simply jiggle the bike about until the rotor goes between the caliper and the dropouts fall onto the axle-stubs. This sometimes goes really easily and sometimes takes 20 seconds of faffing.
Then I make sure the bike's weight is on the axle so its seated, and do up the QR properly, so the lever ends up upward and not touching the frame.
Final checks, I lift the rear of the bike and spin the wheel by hand. I'm looking for frame rub and maybe brake rub, and anything that is just wrong. Also test that the brake on this wheel works right and retracts when released.
Note that you'll be starting in your hardest gear, so consider changing gear while stopped before pulling into traffic.
Some people put wheels in with the bike on its side - I can't do this at all; it just doesn't work for me.