I am not a lawyer. However, I went from being a retired police officer to assisting Criminal Defense and Civil Rights attorneys. I was a person who believed "The law is the law. period." I thought I would have trouble transitioning. I did not! Why not? Because, as an attorney, your job is to do the best you possibly can for your client. One of the first cases I worked on concerned a young man whose face was punched up pretty badly because he was "resisting arrest" and "failed to identify." It didn't matter what I thought of the situation. The challenge was to win the criminal cases, so we could then file the Civil Rights case. We did!
All of your clients are people first. They have children, parents, and spouses who will be adversely affected if your client is locked up. Even if they did in fact commit the crime, it is still devastating.
I can't speak from a prosecutor's perspective. A prosecutor represents the state, which, is really "the people." His or her job is to see that the desire, and will, of the people, as codified by law, is carried out.
As a police officer, stepping into the uniform was like stepping into a costume, playing a role. My personal beliefs did not matter. I arrested people I did not want to arrest, and released people I wanted to arrest, because that was what my job required. I would imagine prosecutors do something similar. You will learn to "compartmentalize," keeping work and personal lives separate.
The law is very interesting!
Wishing you the best!