Planning Ahead

How much money should I be withholding to pay $X amount of money, pay $0 in tax, or refund $X amount of money at the end of the year; is there a way to calculate this myself?