In court, the prosecutor presents the complaint against the defendant by making an opening statement, presenting the evidence and making a closing argument. If witnesses testify, the prosecutor cross-examines them. He can challenge evidence and witness testimonies. His job is to prove the defendant's guilt beyond a reasonable doubt.
The prosecutor represents either the local, state or federal government. It's his job to seek truth and justice, not to get the defendant convicted. However, a prosecutor is often judged by how many convictions he gets. He decides whether to prosecute the defendant based on the evidence available to him.
The first time the defendant appears before the court, which is called the arraignment, the prosecutor recommends a bail amount. He could also recommend denying bail if he feels the defendant should be kept in jail. He prepares the case against the defendant and is required to notify the defendant of the evidence, both the evidence against the defendant and evidence that could clear the defendant. He usually meets with the defense attorney to discuss plea bargains. Plea bargains occur in more than 90 percent of criminal prosecutions, as of 2014. If the defendant is convicted, the prosecutor can make a sentencing recommendation.