How do I increase the size of the main partition? As indicated in the screenshot I can't increase the size of the main partition.
Try the following steps:


Shut down the computer and reboot it while pressing  Alt/Option. 
In the boot picker choose your recovery partition (name can vary, depending on your language settings). 
In the recovery partition launch disc utility and perform the steps you tried already.