There may be a time when a disease cannot be treated, or the hamster has had a serious accident from which it cannot possibly recover and euthanasia may be the kindest, or only option, to ease the hamster's suffering.
It is always hard to lose a much loved pet and even harder to make the decision to end your pet's life. But there may be a time when this is the kindest action that you could do for your hamster.
If your hamster has had a serious accident, is suffering a severe illness with no improvement despite treatment or is old and just does not seem to enjoy life any more you should seek veterinary advice. Euthanasia should always be carried out by a veterinary surgeon to ensure that the hamster is put to sleep quickly and humanely. There are myths of humane home methods of putting your pet to sleep but these should not be considered as they are neither as efficient or painless as lethal injection or gas administered by a vet.