Two major types of remedies against government wrongdoing in this area are the exclusionary rule and civil suits alleging torts.
If the police or prosecutors act in illegal ways towards a person, that person may sue them in civil court. If the officials are found to have acted badly, the person suing might get damages awarded. This could prevent government wrongdoing.
Alternatively, the government's wrongdoing can be punished by weakening its legal position in a case against the aggrieved party. The exclusionary rule does this by preventing evidence obtained through illegal actions from being used in court. This could prevent government wrongdoing because officials will not want to jeopardize their ability to win convictions in court.