How to explain to a child about the death of a pet?

When I was young my mother rescued a dog we named Bogart. He was my best friend! He is the reason I'm a veterinarian technician today.

One day I get home from school and my mom turns around with tear-filled eyes to tell me

"Bogart ate the ant poison I sprinkled in the yard today. I took him to the animal doctor and we had to put him to sleep so he could be with Jesus."

I can't even explain the feeling I had. I cried for weeks. My best friend died. Was this a good way for my mom to tell me? Is there really a good way to tell a child their pet has died?