"Peace comes into the heart like the morning sun spreading across the ocean. It is the ocean of compassion."
--Stephen Levine

It's very important to be solidly grounded in earth energy as long as we are in physical bodies.  People who are spiritually oriented can be quite connected to heavenly energies and at the same time be very ungrounded.  If you ask an electrician what would happen if you had a house without a grounding line, he or she will quickly tell you of the dangers of being ungrounded. 

On an energetic level, being ungrounded keeps us from being as effective on earth as we want to be---and also makes it harder to "stand our ground."  It's possible to be "so heavenly minded that we're no earthly good."
Okay---so let's start.  Imagine you are a very big tree with huge, deep roots coming down from your feet and your seat.  Feel the solidity of that.  This "big tree you" can't be knocked over because you have such an incredible root system.  Imagine---and pretend you can feel---your roots going miles down into the earth until they reach the very center of the earth.  You can't get any more solidly rooted than that!  See if you can get a sort of physical sensation of that degree of rootedness and solidness.  Just feel it for a moment---in the body.  If that's hard to do, just pretend it.  Take a "body print" of that sensation for your future reference.
What is the purpose of a tree's roots?  Besides keeping the tree solidly planted in its spot, they also draw moisture and nutrients up from the soil.  So let your roots do the same.  Let them draw up nutrients and nurturing from the center of the earth up into your body.  Imagine your body is the tree trunk, and the trunk keeps going up through the top of your head.  It goes miles and miles up until the twigs and leaves reach the heart of God, or Source, or Goodness, or Heavenly Light, or whatever name you love to call the Creator.
Think of the function of leaves.  Through photosynthesis, they draw light energy from the sun into the plant.  So let your leaves draw down the love and light of Source down into your twigs, branches, and trunk, coming down, down, down, through the top of your head and into your body.
Now practice drawing up the earth energy with a breath, then exhaling.  With the next inhale, breath down the heavenly energy, then exhale.  Do this several times until you can imagine that you are really drawing these energies into your body.
Next  practice drawing the energies from both earth and Source into your body at the same time.  Breathe them in, then exhale.  Do this until it seems natural.
Then with the next inhale, draw the energies from both directions and into your heart.  Let them merge in the heart and form a golden ball of light there.  Then on the exhale, let them flow out and move into your whole body and beyond the body for about 3 feet or so, forming a sphere around your body.  The sphere will go down into the earth under your feet.
Let your breathing become slow and regular as you breath into your heart from earth and Source, forming the golden ball in your heart, and breathing out into your whole body and around into the sphere around you.  Feel the sense of flow that comes with this, of ease and relaxation.  If you notice any tension or sense of effort while practicing this, instead of trying to get it right, just allow the process to happen without being perfect about it.  However you do this is right.  Be compassionate with yourself (always!).
An alternate way of doing this exercise, instead of imagining being a tree (although I think it's kind of fun to be part of the plant kingdom), is to imagine a column of Light about the diameter of a fluorescent light tube going through your body, down from your seat and up from the top of your head, and draw the energies in through the column.
You can even imagine a power cord going from the tip of your tail bone or the  bottom of the column of Light down into the earth and plugging into a big outlet there, and another one going up.  When I first learned to ground myself, I would get the sense of my body being planted in the earth and my feet going down to the center.  It doesn't matter which image you choose.  Energy follows attention.  It's your attention and your intention that is important.
It is very valuable to practice this often, even daily.  It can be a form of meditation if you like.  Then during the day, if you're feeling spacey, unfocused, having trouble concentrating, or having a hard time maintaining your position and your boundaries with someone else, quickly shoot your roots down and your branches up and get solidly connected in both directions.  The more you practice this, the easier and quicker you'll be able to do it when you need it.
Enjoy the feeling of being in your body, grounded and connected, and flowing. If there is a situation where there is a lot of emotional chaos and people are being reactive, you can help smooth out the energy in the situation (whether you are physically there or not) simply by attending to your own energy.  If you realze you have absorbed some of the emotional upset into your own system (easy to do when energetic boundaries are fuzzy), simply give the direction to "turn on" your grounding cord, and siphon off the discordant energy.

Try it sometime.  It's fun!  Without saying anything at all, just go inside yourself. Ground yourself, become aware of your connection to Source and breathe those energies into your heart and out into the sphere around you.  Your energy will become more stable and harmonious, and through the principle of harmonic resonance, other people's energy will gradually begin to attune to your calm and peaceful energy.  Someone may still be upset, but the intensity will probably be less.  More importantly, you will be less reactive yourself and less able to be thrown off kilter.
The more you practice this, the easier it is to access stable, coherent energy when you need it.  It's like putting money in the bank for a rainy day.  The rainy day always comes, but you're prepared for it.  So practice when you don't need it.  Save your money while the sun is shining.