If you’re in the first 180 days of your contract you’re eligible for an entry level discharge, where basically you just quit (If you qualify let me know and I’ll explain further).If you somehow manage to become injured badly you can get a medical discharge (It’s pretty hard to fake this one, it seems like if you try to injure yourself you won’t get discharged out of spite.)
There’s also such a thing as a “hardship discharge”. One example of this would be say, if you’re family were to suffer some tragic accident leaving you as the only person to care for your 5 year old brother. Because this hardship didn’t exist prior to joining, and can’t reasonably be resolved while you’re in the marines, the corps could choose to release you from your contract to allow you to care for your brother. This one is also near impossible to fake, but should (God forbid) such a thing befall you, I would like you to know it exists.
Short of all of these things, the main way out is to finish your contract, and try to convince anyone you know back home who may be interested, not to join. I hope this has been helpful.
Safety and Peace