How do you deal with an 'on the way out' pet?

A good vet will sedate first, sometimes with a lower dosage of the same drug.

Having you there so that the last things they see, feel, and hear are you is IMO "the right way".

I could not shoot a pet (unless that was the absolute last possible alternative, like If we were out in the wild with no time and no civilization) because the last thing that they would experience would be me scaring and/or hurting them.