It seems very complicated at first but it does click in if you keep at it and you eventually wonder why you had so much trouble with it.
At the start, your best bet is to work in binary so you can mentally visualise what is going on with the bits. This really helps.
You will find many other posts in these forums regarding this exact topic. It is always a stumbling block for everyone when they first start going through it so you not alone. Go through the FAQs and scroll back through several previous months worths of posts and you will get a lot of detailed information.
You will find there are a few different ways of doing it so pick which you find best for you. Remember, for the exam though, subnetting is where you shave off seconds which can be better spent on other questions and they are often a small part of a much larger question like a sim or something so it is important to get them done quickly. You will find that the simplar questions can eventually be done in less that 10 seconds with about 20-30 seconds for the more complicated ones.
Finish it off by spending a lot of time on subnettingquestions.com to really hone your skills.