I've been arrested but not convicted can I still get a visa or green card?

I was arrested because I was at the wrong place at the wrong time and I don’t know what happened because I was not guilty of anything but i was charged.im a good Christian kid with decent grades and does not do drugs but this situation was unfortunate, they denied me once because my case was unresolved and now i won the case with no conviction and no record. Except a 1st degree trespassing im 18 years old fyi I’ve tryed everything to make my self look better and more trustworthy like getting a job and doing volunteer time also pulling up my grades. My case is really hard i guess, I’ve hired an immigration lawyer and she said immigration could deal with a 1st degree trespass charge and it being my first offence. I just wanted someone else’s opinion. Maybe someone with experience? What do you guys think?