When you get arrested and put in jail for something, it is often possible to not stay there until there is a hearing or trial about the incident you are alleged to have been involved in. Police and law enforcement response is by nature supposed to be fast, to find troublemakers and get them off the street, charging them with crimes. However, formulating actual charges and preparing prosecution takes time, and courts are often booked up far in advance. So, the time between your arrest and your court date can be drastic.
If you want to be back out in your normal life in the meantime, then you first have to figure out if securing your release from jail is even possible. In very trivial affairs, or for matters that are not considered a particularly high priority, you might not even have to ask for an attorney or a lawyer. The officers processing you might let you know that you are just going to get processed and then released either that night or the next business day. While they are there to uphold the law, if you are not considered dangerous or a flight risk, then they are not going to waste tax dollars holding you up behind bars, letting you go after you have an initial hearing with further proceedings scheduled by a judge.
On the other hand, if you are charged with something particularly violent and considered a possible flight risk, they might ask a judge to remand you into custody until you actual court date. In these cases, it is far better to have an attorney represent you. You will likely be offered one if you can not afford one, and if you can not, you should take advantage of this right. Having a trained professional at your side in that hearing might determine whether or not you go free until your day in court, or at least influence your level of bail or bond set by the judge with the help of bail bonding agency.