To follow up on Ms. Ramirez' answer, a criminal defense attorney can often accomplish quite a bit for a client during the investigation, and before the client is charged with a crime.
The lawyer can prevent agencies from obtaining incriminating statements from the client by invoking the client's rights. In many cases, particularly where there is little or no physical evidence, police will not proceed with charges unless they obtain a confession or incriminating statement.
The lawyer can also provide exculpatory information to the investigating agency, and negotiate with the prosecutor to have the case dropped, for a diversionary disposition or for reduced charges.
In cases where the prosecutor decides to proceed with the case despite the efforts of defense counsel, your lawyer can often negotiate a lower bond, and arrange your surrender and release.
Absolutely, and this applies to public defenders and private attorneys. The one rub for PDs is that usually the Court wont appoint the PD until after you've been arrested. If you have no means to hire an attorney, call the PD's office and explain your situation. Depending on which attorney you get referred to, they MIGHT seek an appointment to your case pre-arrest. It's a stretch, but it's not completely impossible.
Of course, if you hire an attorney, then there is no question whatsoever that they can represent you, and probably impove the ultimate outcome of your case by pursuing the leads Mr. Smith outlined.