When a hamster dies you can either dispose of the hamster in the trash can or bury the dead hamster in your yard.
When I had a hamster that died I just dug a small hole in the yard and placed the hamster directly into the ground about 1 foot down.
The hole doesn't have to be very deep to bury the hamster as a hamster is small and just needs a small hole for it to be buried in.
You can also place the hamster into a plastic container and seal it like a coffin or just put the hamster into a box and bury it.
But the hamster doesn't need a coffin to bury it.