You can quit the military if you want too as long as you go through official means of getting out of the military.
But once you get into the military it can be hard to just get out of the military just like that.
When you sign up for military service you're basically signing away your freedom and are basically being signed up for prison.
Although it's not prison and you're not locked in a prison cell you're still basically owned by the military and have to follow the military instructions.
If you leave the military without permission then it becomes a crime and you could face jail time or prison time for it.
Leaving the military without official leave is called going AWOL and it's not a good thing to do.
AWOL in the military means Absent Without Official Leave.
Being AWOL is not when a person has gone crazy but instead just means the person in the military or army has left without permission and took a leave without getting it approved by the army personal.
If you go AWOL then they will usually send the Military police after you and arrest you and bring you back when and if they find you.
Then you could face a year in jail or even prison time.
If it's your first time going AWOL then usually you'll just get 30 days without pay.
The punishments can vary depending on the offense of being AWOL but for example being AWOL for just 3 days can mean a confinement for one month and forfeiture of two-thirds pay for one month.
After 30 days or more of being AWOL, service members face dishonorable discharge, forfeiture of all pay and allowances, and a one-year confinement.