It all depends on what country you live in really, but in the US and UK you would have one provided to you.
This is known as Right to counsel, and means the defendant has the right to have the assistance of counsel (i.e., lawyers).
If the defendant cannot afford the legal fees, this same right requires that the government procures one on the defendant's behalf - or simply pays the defendant's legal fees.
The right to counsel is seen as a "constituent" of the right to a fair trial, as it would be unfair if only the prosecution had access to professionally trained legal advice.
However not all countries recognize this right, and some have a slightly different interpretation.
For example, if you are interrogated by US police, you have the right to a state-appointed attorney. In Canada however, no such right exists during the interogation process I believe.