It is not mandatory to have a lawyer for divorce. You can represent yourself in court. It is called “pro-se”.
But it is easier said than done, because the legal system has been purposely made so complicated and difficult to understand and navigate, that for a normal working individual, it would be almost impossible to learn all that and attend all the court dates and balance his work life as well.
On top of that, it is has been said that Judges usually don’t like people representing themselves, because more often it happens that they do now know all the rules and regulations and ways of the legal system and end up either harming themselves or wasting the time of the court while attempting to do so.
I think another aspect is that the Attorneys and Judges would naturally not like the fact that they could not ooze some money from the poor hapless guy or gal.
But having said all that, I have heard about and even seen lots of folks representing themselves and doing a fairly good job of it as well.