Can a lawyer represent himself when he is sued? Or should it be divided into civil or criminal cases?

You can't be your own agent. It is necessary to distinguish between civil and criminal cases.

Because the lawyer is sued and the lawyer is the party, the party can defend himself, and the party does not have to hire an agent.

Since I am a lawyer, I should know some legal issues and defend myself.

In criminal cases of capital punishment, you need to hire an agent, and you can't defend yourself.