A substitution of attorney occurs when the attorney of record is changed on a given case after the case has begun. Such a substitution can occur in either a civil or criminal court. It most often occurs upon the request of the client, although occasionally the attorney himself can request to be excused from the case and replaced.
When a person files a lawsuit, he generally hires an attorney to represent him. That attorney is vested with the rights to speak for the plaintiff in court under the terms of the attorney/client relationship. This means he has a fiduciary duty to represent his client's interests and he has the right to file motions, pleadings and other court documents on the plaintiff's behalf.
The same is true when a defendant is sued. Normally he too will hire an attorney who becomes his representative in court. That attorney is named in court documents and any actions he takes in court on behalf of the defendant are considered to effectively be the work of the defendant.
Finally, in criminal court cases, the defendant has his own attorney as well. The attorney may either be hired privately by the defendant or appointed by the court as a public defender. In either case, the attorney is referred to by the court and in court documents as the attorney of record.
If a plaintiff or defendant in a criminal or civil case wants to change his attorney after the trial begins, he will need to request a substitution of attorney. In a civil case, this is normally relatively straightforward. The plaintiff or defendant hires a new lawyer, who moves for a substitution of attorney, and the old lawyer is excused and the new lawyer now has the right to represent the client.
In a criminal court case, this can be more tricky, especially if the attorney of record was a public defender. The defendant may not simply be able to request a substitution of attorney or a new public defender. Depending on the jurisdiction, he may have to make the court aware of the reasons for the request for a substitution and the court may evaluate those reasons to determine if appointing a new public defender is the appropriate course of action.
Although it is rare, an attorney may also ask the court for a substitution of attorney. In other words, the public defender representing a client may ask the court to relieve him of his duties and appoint a new public defender. This normally occurs only when a serious conflict of interest or disagreement on the case occurs, and is not common.