If I really had to, then I would. Only driven by the love I have for my pet and desire to end their suffering. I'm talking about an accident like hit by a vehicle and suffering at the side of the road or something similar. Otherwise Id prefer the death to be administered by a vet through a lethal injection.
I have had to end an animal's suffering on my own. Not a pet but it was a baby bird. Our cat had gotten into the nest and had savaged the poor little thing. Then it lost interest in the bird and just left it to die. Bleeding and broken legs/wings. Parents had flown away and the poor chick was chirping and Im sure it was painfully dying. It killed me to do it and I was on the verge of tears but I had to. I put the bird on a flat shovel and then dropped a heavy flat rock on to it. Instant death. I pushed the remains off the shovel and into the woods.
I haven't had to end a pet's life, but I did watch my dog get smashed by a car and die rather quickly when I was ~ 8 years old. That sucks.
I've had to kill one baby bird and mice and rats that were savaged by the cat, but for the rodents, this is second nature. i just do a quick cervical dislocation and boom, done. ...pretty much part of my daily job, so such things are wholly removed from conscience, I guess.
The bird was tough, because we watched those parents nest the entire season and because those damn parents nested right at the door, it was tough not to disturb them and even tougher keeping the cat from being interested, the nest being just out of her reach. ...of course, the day those things fledge, and despite trying to keep the cat out of the yard for a week, she rushes out at one point and within minutes, returns with one of the 2 babies squawking and bloody in her mouth. The cat was happy and proud. I wasn't.