As I said earlier, it's a matter of caring and respect. If you've never loved an animal nor were in any way bonded to a pet you may be at a loss for words of comfort. Let your conscience be your guide. Remember that the pet who is now gone from your friend's life was a big part of their world. Treat the loss as you would if your friend lost a family member because quite frankly, for animal lovers this is exactly how it is.
Pets are family members.
Be upfront with your grieving friend and tell them that you don't fully understand the pain of losing an animal companion but you will do what you can to lend a shoulder of support. When someone has lost a pet there is no replacement. Please keep in mind that for most of us losing a pet is life-altering. Our pets are family members who have been by our side through thick and thin, often being there for us long after our fellow humans have walked away. Pet grief is not a short-term situation for most animal lovers.