One word - practice
I don't go for tricks, preferring to know stuff like subnetting inside out. So I recommend you write out some addresses and subnet masks, then write it out in binary, write out your first useable host address, last useable host address, broadcast address and subnet address. Do this over and over.
I see a lot of people stumbling over something I believe is basic knowledge. You must be totally comfortable with working in binary and with the concepts of masks - not just for subnetting, but for access lists, IP Precedence in QOS, etc.