what is it called an attorney who works with the police to prosecute crimes?

A prosecutor, also known as a district attorney or state attorney, is an attorney who works with the police to prosecute crimes on behalf of the government.