Sometimes it just happens condom breakage.
First make sure you check the expiration date of your rubbers.
Condoms need the right temperature to maintain efficacy, and storing them in a hot bag may destroy the condom’s integrity.
Make sure you are using proper lube, not vaseline or only spit. Water-based lubes are your best bet.
But if you know it happened, go to the doctor and make sure you are tested for all the STIs. You can also take Plan B to prevent pregnancy.