You have to boot into the recovery mode option + R and open up disk utility, in their click on your hard drive and then select the partition you want to resize, click and drag it to fill the box (assuming you want it as the only partition) and click apply.
Done.