Before you meditate, or do other spiritual work such as energy healings, divination or magick, you should prepare and protect yourself. You do this by grounding yourself, centering your energies, and shielding yourself from unwanted influences.
Centering is simply returning all of your scattered energies to home base. Usually throughout the day, you have little energy tendrils out doing things while you are attending to business. Perhaps you are writing a report, but one 'eye' is on the clock, because you have a meeting coming up, and a fragment of your attention is thinking about your children, since one was sniffling this morning, and you also have a fraction of your mind drafting a letter of resignation you know you'll never send.
To center yourself, call in all your scattered bits of attention and focus, and bring them into your body's space. You are mentally compacting yourself around your mental or 'spiritual center of gravity'. People have different concepts of where their spiritual center physically is - one woman told me hers was behind her bellybutton. Some people locate it at their heart chakra or their solar plexus chakra. Pull your energies into a tight ball at the location where they seem to want to be at rest - if you aren't centered, you might feel 'psychically top-heavy', as if you were prone to topple over.
Pay attention to your breathing while you call in all your forces; imagine yourself inhaling white cleansing energy and exhaling dark, dusty 'busy-ness' and futile wheel-spinning. This process can take 10-15 minutes while you're first learning it, but once you learn the 'centered' feeling, you can center yourself with a few breaths at any time, even while driving your car or walking into that important meeting.
Grounding connects you to the energy of the earth, and is important in healing and magickal works since it prevents you from depleting your own body's energy. Simply put, you connect to the earth by imagining you are connected to the earth. Sounds silly, but it works. Here's how you do it:
Imagine you are standing in your bare feet on the ground. (It doesn't matter if you're in your cubicle in a high rise or even flying somewhere on a plane.) Your feet are planted firmly on the bare earth, and by an exercise of your will, you send roots into the earth. As you inhale, you draw energy up through your new 'roots', and as you exhale, you send your roots even further into the earth. Do this for several minutes - you should definitely feel a change in the state of your feeling of 'aliveness'.
Shielding is the process of protecting yourself from the energetic influences around you, and is something you can do independent of grounding, centering, meditating or anything else.
Have you ever experienced a day when you were full of vague, directionless anger? or a strange hope inappropriate to your current circumstances? Before you schedule an appointment with a psychiatrist, see if shielding makes these intrusive emotions cease - you may be taking on the energies of people around you, complete with their own imprimature of hope, fear, anger or whatnot.
Shielding is a skill that you can use independent of grounding and centering, and when you are going into highly charged situations (a court room, a job review or interview, a family argument), shielding is a vital step in keeping your energies separate from all the swirling energies around you.
Shielding, like grounding and centering, is a visualizing process, and everyone evolves their own special shielding ritual. While grounded, draw up energy into your being. Use this energy to form a protective barrier between yourself and the negative vibes of those around you, or random free-floating energies. You can visualize a transparent plexi-glass egg around you - the good intentions and friendly emotions around you are free to pass through your shield, but all bad stuff gets deflected. Some people make shields that reflect negativity back to the source, but this, while perhaps satisfying to one's sense of fair play, still leaves too much negative energy in the atmosphere. Set your shields to 'ground out' any negative energy that impinges on it, and let it flow harmlessly into the earth, where it can be neutralized and recycled into good energy.
Why is this important?
According to Swami Sivananda of http://sivanandaonline.org/
Sometimes, bad spirits will trouble you. They may have ugly, fierce faces with long teeth. Drive them with your strong will. Give the word of command: "Get out." They will go away. They are vampires. They are elementals. They will not do any harm to the Sadhakas. Your courage will be tested here. If you are timid, you cannot march further. Draw power and courage from the Atman within, the inexhaustible Source (Avyaya). You will come across very good spirits also. They will help you a lot in your onward march.
There is a kind of vision one occasionally gets during meditation. You may behold a dazzling light with abrupt motion. You may behold a head of marvellous form, of the colour of a flame, red as fire and very awful to look at. It has three wings of marvellous length and breadth, white as a dazzling cloud. At times they would beat terribly and again would be still. The head never utters a word, but remains altogether still. Now and again, there is beating with its extended wings.
During meditation, some of the visions that you see are your own materialised thoughts, while some others are real, objective visions.
... Very often, depression comes in meditation in neophytes owing to previous Samskaras, influence of astral entities, evil spirits, bad company, cloudy days, bad stomach owing to indigestion and loaded bowels in constipation. It must be removed quickly by cheerful thoughts, a brisk walk, singing, laughing, prayer, Pranayama, etc.