Since we live a lot longer than our pets, it stands to reason that we will, at some time or the other, come face to face with losing them. Whether you know it's coming or it's unexpected, it is a sad and emotional time. Fortunately, there are many ways to cope with the loss.
Steps
Before Your Pet's Death
Accept your pet's fate. If your pet needs to be put down or is coming to the end of its days naturally, at some point you need to come to terms with the fact that everything--human or not--has a time and a place to come, and a time and a place to go. Talk to your vet and ask how much pain your pet is in and if it is worth trying to save him. Based on the vet's assessment and your own judgement, make the decision, with your pet's happiness in mind.
Take pictures of your pet. You will want something to remember him by. Even if he looks sick and miserable, it is very important to take photos, as bittersweet as it may feel. In the future, you may wish to boast about what a wonderful pet you had, and you may want to show people what he or she looked like. Collect anything else you want to remember him by. This includes a favorite toy, a blanket, or a decorative element from a tank or cage.
Spend some time with your pet. Let him know how much you love him, and cherish every moment. Pet him in all his favorite places, and make sure he is comfortable. Talk to him and maybe even sing. Do things that he used to enjoy if you can, like letting him curl up on your lap for hours at a time, giving him plenty of time to roam in the yard, and eating yummy little treats. If there was ever a time to spoil your pet, this is it. At the same time, respect his wishes. If he wants to be left alone, don't violate his comfort. Let him have his way.
Make arrangements as to what you will do with his earthly remains. When preparing for the loss of a pet, you also need to prepare for all the practicalities that follow. They are an absolute nightmare if you're unprepared - and can so add to your grief and stress at the time. You want to ensure you've taken care of all arrangements before hand. You may wish to bury him in your yard with or without a grave marker. You can also have him buried in a cemetery or cremated.
Give family and friends a chance to say goodbye. Before he leaves your home forever, let the people who've enjoyed his presence know that he's not going to be around for much longer. You've been given a chance to say goodbye, and so should they. Assuming your pet feels comfortable with people, getting attention from various sources will make him feel more loved.
After Your Pet's Death
Allow yourself to cry. Bottling up your emotions is not good for you, and you will feel sad forever. Even if you are a boy or an adult, let it out. Forget all that mumbo jumbo that you're not supposed to mourn an animal as much as you would a person. There was a bond that you cherished, and no matter the nature of the bond, it is missed.
Remember your pet. Don't pretend you never had one. Even though it makes you sad, it is best to remember and cherish the memories, not ignore them. It may hurt at worst, but it's the only path to closure, and it's the only way you'll ever be able to remember your time with your pet fondly. This is a good time to make a scrapbook. Include pictures, stories, and notes about your pet.
Go on with life. Although losing a pet is very sad, it is no reason to shut yourself up in your house or go into depression. Your pet has always felt comfort in your comfort, and the sooner you get back on track, the sooner you'll be yourself again.
Tips
Keep in mind that pets are very sensitive to human emotions. If you are miserable, your pets will pick up on it and react to it. Unlike a human being, who will actually benefit from knowing they are going to be missed and that their impending departure causes you a great deal of sorrow, your pet will not understand why you are so sad - they will just feel sad with you - or, may even feel they have done something to upset you. So do try and contain your grief when around your pet.
When preparing for the loss of a pet, involve your entire family, but be prepared for some very different reactions - each one of us suffers in a different way.
Warnings
Be prepared for good days and very, very bad days. The good days will gradually increase and you will be left with the good memories of your pet.
There will be people who think you're odd for caring so much about the death of your pet. Talk with someone who understands.
Don't get a new pet to replace your old pet. Nothing will take his place and it's not fair to compare a new pet to an old one. Every pet is different. Don't start a new relationship with a pet until you've experienced closure with the loss of your previous pet.