Whether your rat injured themselves or you did it, it will bleed – a lot – and will need to be treated.
If the toenail is still attached, remove what you can (carefully!!) with clippers – you might want to ask a friend or two to help restrain the rat gently. Use styptic powder or potassium permanganate (be careful, these stain), flour, or cornstarch to stop the bleeding.
This wound doesn’t normally have complications, but keep an eye on it for the next week, and if complications happen, then seek your vet’s advice.