When you are arrested you will most likely have the choice to either make a bond to be released or if you are unable to will remain in jail while your case is pending. In order to make a bond, you must have money to secure your release and have no holds, like an unpaid traffic ticket.
If you are free on bond, you will need to hire an attorney as soon as possible. Talk to people you know and ask if they know of any attorneys. Internet searches, like using Google, can also provide a large selection of attorneys in your area who deal with your type of case. If you are unable to afford an attorney, the court will appoint one to your case.
Likewise, if you remain in jail you may hire your own attorney. If you cannot made a bond and are indigent, the court will appoint a lawyer to your case within 24 hours. The lawyer will then contact you within 72 hours after the police file a case against you.
What If You Are Not a U.S. Citizen? In most situations, the Immigration and Naturalization Service will place a hold on you that will keep you in jail for the time being (even if you are able to make a bond). In this case, you should find an attorney who specializes in cases with immigration issues because your criminal case will directly affect your ability to reside in the United States.