What should a lawyer do when he or she knows that his or her client is guilty of a crime?

What should a lawyer do when he or she knows that his or her client is guilty of a crime?