Hoping that this makes sense....
With a standard two point sling, and, assuming a right handed shooter....
With the rifle in shooting position, take your left hand (which would normally be on the handguards), and grab the sling right near the rear sling mount (palm down). Let go of the rifle with your right hand, and the rifle will fall against (the outside of) your left arm. Now just sling the rifle, muzzle down, over your left shoulder as your right hand goes for the handgun.
With a three point "tactical" sling, I just let go of the rifle as I go for the pistol. A slight "oomph" as the tactical charging latch whacks me in the ribs, but that's it. Usually, the latch hits the sling and it's not bad....The left hand can hold the rifle against the body, or you can opt for the two-hands-on-the-pistol approach.
You can also just rotate the muzzle down towards your weak side, keep the toe of the stock in your shoulder "pocket". When the rifle is against the body, hold it in place with the left hand, and go for the backup with your right hand.
If it's dark, and you have a rifle mounted light, you can take the rifle with your left hand and stick it muzzle FORWARD under your left arm - the light stays shining forward as your right hand goes for the pistol.
I've seen some other variations as well...
I hope this makes sense. If not, I suppose I could do some photos...