Here's what you should do:
1. Handle the hamster gently: Avoid further injury by handling the hamster carefully and keeping it still.
2. Contact your veterinarian: Explain the situation and ask if they can see your hamster as soon as possible.
3. Transport the hamster safely: Use a sturdy, well-ventilated carrier to transport your hamster to the vet.
4. Follow the vet's instructions: Your vet will examine your hamster, determine the extent of the injury, and recommend treatment, which may include medication, surgery, or supportive care.
Important: Never attempt to diagnose or treat your hamster yourself. A vet can provide the best possible care and ensure your hamster receives the necessary treatment to recover.