The little speech you always hear when someone is arrested is stuffed with essential rights protected by the American constitution. One small part of that is the right to an attorney, and in the event you cannot afford one, an attorney will be provided to you. This right is found in the 6th Amendment of the bill of rights, and has come under scrutiny under the Supreme Court in recent years. The majority of countries around the world have recognized that this right is essential to the defendant’s right to a fair trial.
In America, the Constitution contemplates five rights when it comes to assistance of counsel: the right to counsel of choice, the right to appointed counsel, the right to conflict-free counsel, the effective assistance of counsel, and the right to represent oneself pro se (or without an attorney). The right is only applied to criminal law cases, including deportation hearings.
Basically, the defendant has the right to the first choice of counsel, although this right is subject to conflicts of interest, whether the lawyer is barred in the jurisdiction and allowed to practice, or even if the lawyer wants to represent the defendant. It is a crucial right, as if it is later found that the defendant was deprived of his first choice of counsel erroneously, the verdict is automatically reversed.
In the event the defendant cannot pay for a lawyer themselves, the government must supply one at their own expense. This has been limited to cases where the defendant faces a sentence of imprisonment for over a year (usually a felony). This can vary with some forms of sentencing, such as if the crime is used in conjunction with something else for enhanced sentencing, and depending on the defendant (like whether or not they are a juvenile). A good attorney licensed in your state will be able to give you advice on whether this is your Constitutional right based on your particular facts.
No matter what, the defendant is entitled to an attorney who has no conflicts of interest (such as being related to the victim in question). While many conflicts can be knowingly and intelligently waived by the defendant, some are unwaivable, depending on your jurisdiction.
Ineffective assistance of counsel is probably the most litigated aspect of the 6th amendment, and is usually asserted at the appellate level for criminal appeals. Basically, the defendant is entitled to relief from ineffective assistance of counsel if they can show that the lawyer’s performance fell below an objective standard of reasonableness, and that, without this failure, there is a good chance the outcome would have been different. This is a difficult burden to prove, and in most cases that are successful, counsel has not only been ineffective, but woefully deficient. Unfortunately, given the state of modern day public defenders, many of who are overworked, underpaid, and without sufficient resources, this defense may be used more effectively in the future for those who have suffered through an unfair trial.
Finally, a defendant has the right to knowingly and voluntarily opt to represent themselves at trial, although usually courts order a licensed attorney as standby counsel in the event they are needed. This is not a recommended course of action, particularly if you are facing a crime for which counsel would be provided (as in a felony). Lawyers are trained extensively, and usually develop specialties to assist their clients. A good criminal defense attorney should always be sought out whenever possible when facing potential incarceration, deportation, and/or huge criminal fines.