I had a hamster years ago and it went through something similar: suddenly it became lethargic and refused food. What I learned is that when a hamster behaves this way so abruptly, there's almost always something physical behind it - it's not just being picky. Syrian hamsters are quite prone to digestive problems, respiratory infections, and even tumors as they age, and those are exactly the symptoms: lethargy and loss of appetite.
The first thing you need to do is take it to a vet who specializes in rodents as soon as possible. This isn't something that can wait long because they dehydrate quickly when they stop eating. In the meantime, check the cage carefully: make sure there are no sudden temperature changes (hamsters are sensitive to heat and cold), that it's in a quiet place with no drafts. Try offering soft or wet food like grated carrot or a bit of apple to see if that encourages it to eat, but honestly, without knowing what's causing the problem it's hard to do much more from home.
At 8 months a Syrian hamster isn't exactly old but it's already at an age where things can start to go wrong. The vet will be your best ally here because they can do a real diagnosis. If you wait too long, even if it's something treatable at first, it can get worse. This is a situation that needs professional attention pretty urgently.