Just give her a lot of hugs and love and truly care for her. I'm not jumping to generalizations or trying to be rude, but guys tend to try to fix things and girls cry it out. It drives most girls crazy when guys start brainstorming new ideas about how to fix it when the girl realizes it's irreplaceable. Once you've hugged it out, take her on a date to her favorite place. P. S. I know a lot about hamsters so I can help if you have any follow-up questions. My friend's hamster died of cancer and she's had other ones with bad diseases so I know a lot, but not everything but I can try. Good luck! Sorry for her loss.
Here are some suggested tips on how you can help. Let her accept and express her feelings. If it was a prepared death due to age or disease help her take care of the rest of the hamsters. If it was the only hamster make her consider another Pet. Assist her in Taking special care of other pets. For more ways try www.wikihow.com/Cope-After-the-Death-of-a-Pet.
Just be there bro! listen to her trust it helps so much later in relationship if they realize how much you love them women want most of all to be listened to...or at least that's what I believe...your ears are there for a reason be there for her and I promise she'll be there for you!