Upgrading Motherboard is going to be the hardest and most time consuming part to upgrade on your computer. It's the hub for everything which means a lot of unplugging and plugging back in and a lot of parts. I'd only recommend upgrading your motherboard if you need a new CPU socket, your old one breaks or you need more RAM / Video card slots.
To start you're going to have to unplug your computer and take it apart.Take off both side panels and get some tools handy, You're going to need just a Philips head screwdriver most likely but it's good to be prepared. Now you can start by unplugging all cables from the motherboard. 24 Pin power, 8 Pin CPU, all fans, all hard drives etc. Once you're confident everything is unplugged you remove the graphics card as found above. You don't have to take the CPU cooler out yet but I recommend doing it at this stage to make it easier on yourself. Just unscrew the screws on it diagonally and remove the cooler; leave the CPU in the socket for now.
Now you can locate your motherboard screws, these will typically be around the edges with one or two in the middle and hold your board to the case.They are screws with a little circle flat top -
I'd recommend having the computer on it's side for this part. Unscrew the motherboard; put the screws somewhere safe and then lift it out of the case slowly and straight up. Don't let it scrape too much off of anything.
Once your board is out you can now clean and remove the CPU as found above and remove your RAM as well. Now is a good time to clean the case in the hard to reach places to get dust out if you want. Before you start messing around with your new motherboard take a look inside your case and note the motherboard standoffs which are in your case. There will be two kinds, either rubber standoffs built into the case or more likely the regular screw type which look like this -
These are used to stop your motherboard touching and contacting the metal of your case so it doesn't short. That's important; you DO NOT want to screw your motherboard anywhere that isn't a stand off when you're putting it in.
You can start assembling your new motherboard now. Put your CPU in (make sure it's cleaned of thermal compound) and your RAM in. I'd recommend leaving CPU cooler until it's in the case but that is preference and you can put it on at this step if you want. Just make sure to replace the thermal compound with a pea size amount!
Once those parts are on, look in your motherboard box and you should have a rear IO panel made for that motherboard; it looks like this -
Your old boards one should pop right out (might take a bit of effort) and you can stick the new boards one in. Once it's in you can start lowering your motherboard into the case. Careful not to scrape the bottom of it on the standoffs and make sure it's slotted into the rear IO panel correctly otherwise you'll have a hard time hooking stuff up to it. This step can be awkward but have patience and you'll get there.
At this point the board is sitting in your case on the standoffs, so start screwing. If the board is the same form factor as your old one you should be able to just screw it right in through any holes on the board but just verify there is standoffs where you're screwing.
Once it's screwed in, you can now mount the heatsink if you haven't already using new thermal compound and start plugging in cables and routing them. Start with the 24 Pin power as it's the most awkward, plug in your 8 Pin CPU, your fans and your drives. Once they're in; you can stick in your graphics card and plug it in too.
Don't forget to plug in your front panel IO cables. You will have to refer to your motherboard manual to find where these go in correlation to the pins on the motherboard but it's an easy task.
After you've got every cable plugged back in and every part back in, you can try booting it up. I personally recommend ONLY plugging in the hard drive / SSD that has Windows on it for now until it's booted and plugging the rest in on next boot. It might take a little while to boot and you will probably get a boot screen that says something like listing your hardware and drives etc; this will prompt you to hit a key to boot so go ahead and do that.
Congratulations you've just replaced your motherboard.