You should retain a criminal defense attorney. You may be eligible for a first time offenders program known as ARD. Under the program you do not plead guilty to anything. You are placed on probation without verdict. As long as you stay out of trouble and complete the terms, the case will be dismissed and you will be able to have the case expunged.
Speak to an experienced criminal defense lawyer immediately. Although these charges are relatively minor, they can have a major impact on your life. A conviction for possession of marijuana carries a mandatory 6 month loss of driving privilege in addition to any fine and probation. Conviction of either offense means you will have a criminal record that can come back to embarrass you later in life.
Some counties offer diversion programs for these offenses that allow you to earn a withdrawl or dismissal of the charges; however, you may also have a valid defense. An attorney can discuss the case with you and tell you what is your best way to go. Good luck.
My colleagues, Mr. Keller and Mr. Patterson, have it right. Discuss your case privately with an experienced criminal defense lawyer. Many on this site will provide a brief initial consultation without charge. If you cannot afford counsel, apply to the public defender's office. While you will likely not have to serve time in jail, do not attempt to handle this alone as the charges are serious. Good luck!