A good thing to do before starting this job would be to have small caps ready to put over the master cylinder's fittings. It would also pay to have plastic bags or rags underneath to catch any spillage, as brake fluid
will damage your paint.
I'd
highly recommend getting yourself a Haynes manual for your Corolla, as it has step by step instructions on how to do this job (along with plenty of others) and also includes exploded diagrams so that you can see exactly how each part comes apart and fits back together.
I'm happy to type the whole procedure out for you, but purchasing the manual will be a lot easier to work with and will also come in handy for any future repairs