Have anyone been to court?

Have anyone been to court? I was for the first time in my life it's really scary and i got sentenced for a crime i didn't commit i came home to an old childhood friend after him adding me on facebook and asked me to come when i came he was aggressive and in his sofa laid a lot of meds and i found out he just robbed an ambulance while they tended to a guy he snuk in and took all their things so as the good friend i am i took all the stuff he had and was going to throw them in the dumpster but before i could do that cops came because they knew about the ambulance and i got caught with a ton of heavy drugs and got a charge i tried explaining that in court i said i never taken drugs in my life and my record is clean i never been in trouble with police but i still ended up getting convicted 3 days ago i'm sad because i tried doing a good deed and ended up being charged with having a lot of drugs i don't know what the charge would be in USA but it's the severest one

Have anyone been to court?
Post Opinion