This is the hardest thing programmers can do. It's also the thing that most programmers spend their time on.
The trick is to understand that there is no easy solution. It took years to make the mess. It will take years to clean the mess.
So you simply have to begin. Very gradually, and very carefully, clean up the mess.
Do not turn this into a project. Do not tell your boss "We need 3 months to clean this up and then everything will be great". This project will fail, and you will never be trusted again.
Instead, follow the Boy Scout Rule. Every time you check the code in, check it in a bit cleaner than you checked it out. Do some random act of kindness to the code. Don't do too much, because the risk is too high. Just little tiny cleanups at every checking. And never, ever, EVER, check it in dirtier than you checked it out.
If you do this, and if everyone does this, then the code will eventually get better and better. Soon you'll find that parts of the code are decoupled enough to write some tests. The more tests you write the easier it will be to clean the code.
Read Michael Feathers' "Working Effectively with Legacy Code".