I'm so sorry to hear that. There isn't really a right or wrong thing to do, but if you're debating it then deep down it is something you would like to do but perhaps have some fears or reservations. Sometimes that is a feeling of - 1) am I replacing my loved pet and making his life less meaningful. Or 2) if the hamster died young, fears of, will this happen again? Or fears of - 3) will I be able to show affection and bonding to a new hamster if I loved my previous hamster, and would that be fair?
Whatever the little niggling doubts are, I think it sounds like it might be the right time for you to get another hamster. And if any of those above are fears or worries, we can maybe help reassure some of them.
1) Nothing will ever replace a loved hamster, but you have room in your heart to love another one too.
2) If a hamster has had an untimely death it is essentially bad luck - just as it is with humans. But be conscious of where you find the hamster from - some pet shop breeding is the issue. I think it sounds a bit like this one for you and it is heartbreaking if a hamster passes young. It is not that likely to happen again but I wouldn't get a hamster from the same place. Whereabouts are you? There may be some rescues with litters. Hamsters from rescues are well looked after, receive vet treatment if needed and will be healthy when adopted.
3) What is a good idea is to get a hamster that is either a different colour, a different sex or a different species - so they are totally "their own" hamster and unique. They are all unique anyway and all have different personalities, but perhaps a hamster that looks very similar may trigger feelings. But in my opinion you can always bond with a hamster and if it doesn't happen straight away - hamsters can be patient
A new baby hamster will make you laugh and smile again with their antics and sweetness.
Having said all that, there are practical things as well. Is the cage or enclosure suitable, and the contents, and could you afford to put a small amount away each month towards a vet fund in case it's ever needed. Eg £15 a month. Unless you have alternative savings you could use for example.