I find that works best

Having someone come in daily to do food and water. The hamster still has some kind of daily familiar routine that way. Mine tend to hide away a bit when it's a different person coming in but are happy to see me again afterwards

Some people do take them to a friend or relative. That is a bit more upheaval for both you and the hamster, so not ideal, but it can work, especially if it's someone they already know.
Some of it depends on the hamster's personality as well. With one of our hamsters he used to pine and go downhill a bit if I wasn't there for a few days. (Partly because of a previous experience described below!) So when he got really quite old, we made our holidays work around him and booked a holiday cottage 2 hours away from home! And took him with us - he was happy as larry, even though it was a different house, and a temporary cage set up and slightly smaller cage (tip - bundle up their bedding and some cage contents to put in a temporary cage, so it still smells familiar). Normally travel isn't good for hamsters, but circumstances vary. I know some people who would just not have holidays when they had a hamster!
However the pet sitter/person coming in daily works very well - and has worked for all our subsequent hamsters

The one thing that worked badly for me (with our first hamster) was taking him and his cage to someone else's house who had other hamsters. He was extremely stressed after this and never quite the same again. Someone else's house without other hamsters might work though - if it's someone they know.
But stability is best - staying in their own home and cage with someone coming in to do food and water each day. If that someone could spend a few minutes chatting to the hamster as well, that helps - even if they're just talking to a seemingly empty cage if the hamster is hiding away! I think it helps them know they are not abandoned.
The same person does this for me each time so the hamsters got to know her a bit as well.