If your hamster stops eating or drinking, consult the vet asap. Without food and water a hamster will fade and die very quickly. The symptoms are usually indicative of a serious health problem.
Hamsters that stop eating and drinking need to be taken to a veterinary attention
Before assuming there is a health issue, quickly check to make sure your pet actually has access to food and water. Is an obstruction, malfunctioning apparatus, or aggressive cage mate preventing access to the food tray and drinking bottle? Is your pet having trouble moving, and therefore unable to get to the food and water? Is the food mouldy or spoiled in some way?
Once you're sure none of these issues are at the root of the problem, you can conclude that it is a serious illness, which will need immediate veterinary attention.