Law school. ;)
Okay, okay. Seriously, besides getting a lawyer and have them draw you up a standard contract, there isn't much you can do to "wrap your head around [contract negotiation] for good" as there's just too much to learn. Some of it comes from experience (you'll start getting a radar for certain kinds of clauses), and there's no quick fix for getting experience besides the passage of time. Specifically, make sure there is a provision in there for getting some of the payment up-front (as grandparent suggests), and specify a late fee % for any overdue bills.