Short answer: Learn to roll cast
Long answer:
I had the same problem too, as I think many new flyfisherman do. I don't think there is any one thing you can do, you just have to fish a lot.
I equate casting to learning to drive a stickshift. It's a little rocky at first, your concentrating on where to slide the stick, how much to press/release the clutch, what your RPM's are, how the engine is sounding, how its feeling, etc. After some practice, everything becomes second nature, and instead of thinking about when to shift, you just feel when to do it......and do it!
I've found casting is the same way. When you start out, your thinking about so much stuff that your casting with your concious mind, rather than your instinct and feeling. Once you cast a lot, you get more comfortable with the dynamics of your line, and eventually you are able to know and control exactly where your line will be in all stages of your cast, without even thinking about it.
Being able to unconciously know what all your surroundings are (branches, trees, shrubs, boulders, etc) and adapt your cast to fit those surroundings will make those tight spaces seem magically do-able. However, adaptation is only possible if you are very comfortable and familiar with your rod and line, which just comes with practice.