This can be a misdemeanor underage drinking, or minor in possession of alcohol. Additionally, if you are driving after a beer or two it can be a DUI/under 21 which has more extreme consequences under California zero tolerance laws.
If you are caught with alcohol in your possession you will most likely be given a citation for a minor in possession. This can be charged either as a misdemeanor or an infraction. If you are convicted of either your license will be suspended for one year. You would be eligible for a restricted license but would have to apply for it through the court. It is in the judge's discretion as to whether or not one may receive a restricted license. You must be able to show there is no other feasible means of transportation. However, a restricted license would only address driving to and from and during work, to and from school and sometimes for medical issues.
Some jurisdictions do have diversion type programs where you would be able to do class to avoid the minor in possession conviction and the license loss. In Santa Barbara you plead to the MIP plus a loud and unreasonable noise then are required to take the class and return to court in three months with your proof of completion. If you do so the MIP is dismissed and you are left with an infraction for loud and unreasonable noise. You are required to pay a $406 fine.
Remember if you are under 21 and found to be driving with any amount of alchol in your system it is a violation.