Legal representatives in court are generally called lawyers and they could be made up of any combination of solicitors and/or barristers.
A barrister will speak in court either for the defence or the prosecution. Usually, but not always, barristers deal with Crown Court cases and solicitors deal with magistrates court cases. If you are looking at the judge or magistrates, the prosecution sit on the right hand side and the defence on the left. If there is more than one defendant there might a different barrister for each defendant.
Prosecutions are normally carried out by the Crown Prosecution Service (CPS) on behalf of the Crown (the Queen).
Both barristers try to persuade the magistrates or jury what really happened. The prosecution presents the evidence which they say show that the person is guilty and the defence present evidence which they say show that the person is innocent, or that there were reasons for what they did.