Guilty clients

I am a senior in high school looking to become a public defender — admittedly, very long way to go — and I know this question must have been asked hundreds of times, but how do public defenders cope with the possibility of successfully defending a guilty client who has commited particularly heinous acts such as sexual assault, homicide, or some other seriously immoral conduct. I want to commit myself to an honorable career, and I believe representing those at their lowest is a future I will thrive in. But I don’t want to be responsible for a human committing an evil act again.

I understand the job needs to be done. I understand that the job is to force prosecution to abide by due process, but do public defenders struggle with this? Is this a common problem?