Probation is one way to avoid time in jail, but it comes with strings attached.
Living With Your Probation
Probation Search Conditions
What’s the difference between probation and parole?
Who has more of a privacy interest: a probationer or a parolee?
Do I have a right to an attorney at a probation revocation hearing?
What's the difference between formal and informal probation in California?
Suspended Imposition of Sentence vs. Suspended Execution of Sentence in California