If you joined age under 18 and are almost 21, or if you joined aged over 18 and are close to being in the army for three years, then soon you will be able to give one year's notice to leave.
Once you do, the army might let you leave after just six months, rather than a whole year, but it might not. This is called 'Early Termination'.
If you leave in this way, you'll be on the reserve list for the next six years, so the army can still call you out to train or deploy. Most soldiers don't have to do this, but it can happen.