A Defense Attorney is a lawyer/attorney who specializes in Criminal Law. He/she works for the accused, trying to get them acquitted, or at least get the lowest sentence possible, get probation, etc.
A Prosecuting Attorney also specializes in Criminal Law. He/she represents the State, and is trying to convict the accused.
ALL attorneys are "officers of the Court." They have a duty to be truthful.
Professional lawyers focus in a small subset of the law, but there are MANY areas. You may write estate plans and wills. You may write contracts for large companies (or read them). You may focus on creating patent applications. and there are many, many more areas. You may prosecute criminals, or defend those accused of crimes.
When there is a disagreement between two parties, there is usually a lawsuit/court case. Once side - the plaintiff - says "That person did something wrong and owes me compensation!". The other side - the defense - says "no we didn't!!! They are WRONG!!". Each side has attorneys/lawyers. So both the plaintiff and the defense have lawyers. The defense attorney is just one of the lawyers (or a group of lawyers) who are arguing one side of the case.
In criminal law, the government is the one saying "She did something wrong" - speeding, murder, theft..etc. some kind of crime. They are usually referred to as the prosecution/prosecuting attorney, or even just "the State". The lawyer representing the accused is the defense attorney.
Think of it like this: The are dogs (broad category), but there are also beagles, chihuahuas, golden retrievers, dachshunds, bulldogs, poodles, mutts etc. (all of which are special breeds).
I am a lawyer (aka "attorney"), but I am not a defense attorney/defense lawyer/defense counsel. I practice law, but the type of law I practice does not involve the defense of an alleged criminal in a court. My practice is mainly different types of corporate law (e.g., environmental law, anti-corruption and other related fields). My clients are companies/corporations (not individual humans). I work with the people in companies to ensure compliance with laws that effect their business. (There is some small overlap with white collar crime, but even in that case I represent the company, not the person.) This is NOT the kind of law practice you often see in TV law dramas....
A Defense Attorney represents people who are alleged to have broken a law (aka the Defendant). They are also known as criminal attorneys or criminal defense lawyers. This is often the kind of law practice you see on TV - with courtroom, the jury foreman/forewoman saying, "You honor, we find the Defendant [not] guilty..." Defendants can hire their own defense attorney (e.g., former football star/actor OJ Simpson hired Kim Kardashian's father -- the late Robert Kardashian -- to be his defense attorney when he was charged with murdering his ex-wife and her friend). Or, if they are too poor to hire a defense attorney on their own, the court can assign an attorney to the help Defendant mount his/her defense -- this is a right established in the U.S. Constitution. These assigned attorney are called "public defenders". You might have heard this "Miranda Warning" on TV shows or read it in books, when a cop says to someone they are arresting, “You have the right to remain silent. Anything you say can and will be used against you in a court of law. You have the right to an attorney. If you cannot afford an attorney, one will be provided for you. Do you understand the rights I have just read to you? With these rights in mind, do you wish to speak to me?”
The person on the other side of the court room, trying to prove the Defendant's guilt is the Prosecutor. Typically, for state or local law matters, the highest Prosecutor is the District Attorney (DA) -- so an attorney from the DA's office will be the working opposite the Defense Attorney. For federal matters, it's the U.S. Attorney. The laws that have allegedly been broken -- state/local laws or federal laws -- will determine who the Prosecutor is.
All lawyers have a duty to zealously represent their clients, including Defense Attorneys. Also, all lawyers have a duty of truth to the court/judge, including Defense Attorneys. Thus, Defense Attorneys will try a few things: (1) highlighting procedural errors on the part of the Prosecution (e.g., evidence was mishandled, scientific findings were erroneous, eye witnesses were mistaken, "objections" in the court to certain testimony or evidence) or (2) installing doubt about the defendant's alleged actions (is there another person who may have done the crime? did someone else have motivation?? does the Defendant have an alibi???). The prosecution must establish the Defendant's guilt "beyond a reasonable doubt" so much of the work of the Defense Attorney is planting seeds of doubt and hoping to lead the jury to conclude the Prosecution's version of events wasn't the only credible explanation.
Desiree recommends the following next steps: