While it is true that it is human to make mistakes, it is important that you do all you can to keep these mistakes from landing you in jail. When you find yourself in legal trouble and are waiting for your trial to begin, the biggest mistake you can make is going into that court room without preparing for it well. You need to do all you can before the case to set yourself up well.
Even if you are guilty of a crime that you are being charged with, it is very important that you put effort into finding the right US pretrial services and a lawyer who can help you come out of court with the lowest possible sentence. There are all kinds of legal precedents that could make your case more successful. Having good preparation for a case can help you utilize these fully.