Are you just starting out with After Effects? Here is an excellent tutorial to teach you one of the fundamental concepts of creating amazing visual effects: masking.
All visual effects are created by layering multiple visual elements on top of each other. Masks are used to define which parts of these layers are visible and how these elements are combined into the final effect.
You can find a detailed written version of this tutorial with step by step instructions on my website: