As a criminal defense attorney, your duty is to get the best possible outcome for your client. However, you are an officer of the court, and should not allow your client to commit perjury. So, you try not to put the client on the stand. If they insist on testifying, they will often "testify in the narrative." This means they simply tell their story, rather than the attorney drawing it out of them in the question/answer format. The problem is, most people recognize that this is being done simply because the attorney wants no part in assisting the client to lie under oath!
Your focus will be on attacking the prosecution's case. What evidence do they have, and does it prove your client's guilt? Are there other possible suspects? Plant the seed of doubt. If your client gets convicted, try to get the best possible punishment. And, if somewhere along the way a plea bargain is offered, evaluate it and make recommendations to your client.
I used to think that representing criminals would bother me. I am not a lawyer, but do some work for a criminal defense attorney. As a former police officer, I thought this would be difficult to do. However, everyone deserves a fair trial, and, if you look around, lots of people get second chances. Why should my client be any different?
If you are uncomfortable with this, keep in mind, there are many other types of law out there, you don't have to do criminal defense!