Grounding and centering are the most basic skills in ritual, meditation, or magickal working. It is essential to have a good grasp of these for focusing. They are also useful skills to have in mundane situations.
If you go to a group ritual or guided meditation, most of the time there will be some form of grounding and centering. The exact visualizations, sensory cues, and sometimes words applied will be different depending on the tradition or ritual facilitators experience and style. This is a practice, and the details of how that skill is developed or what visualization works can vary.
Grounding is connecting yourself to the earth, and by extension the world around you. It is a great way of releasing tension, connecting emotionally to the earth, understanding your place in the grand scheme of things, and strengthening your resolve.
Centering is connecting all parts of yourself to your highest self, the divine, Asgard—whatever you wish to call it. It is becoming aware of yourself and your own needs and desires.
Both of these are skills that take practice to learn on your own. Don’t expect it to click the first time you try it. At first, it will take time and some concentration. Start out practicing in a place and during a block of time you will not be disturbed. There are recordings of guided meditations to ground that are good for beginners (and advanced practitioners that want a refresher). But once you have a good grasp of both, its easy to slip away for a minute in a tense situation, ground, and find yourself ready to face the rest of an impossible day.
I do a tree visualization. (I stick with trees, probably because I have had some experience in Celtic/Druidic traditions.) If outside I prefer to stand with my bare feet touching the ground. In the summer it is easy to wear sandals and slide them off to stand while grounding. The yogic mountain pose is helpful, or if you have martial arts experience a pose meant to stand in for a long time is useful. That is simply my preference—any mobility issues or if sitting is more comfortable there is no shame. Sitting at your altar to practice would work when starting out, but once you have a good grasp try to ground other places. This is one basic skill that should be practiced everywhere, so you don’t get stuck in a rut of only being able to ground while at the altar. While riding the bus is a good time to practice.
Once comfortable/ in your pose, imagine roots reaching down into the earth. If you do chakra work, imagine a root from your root chakra going into the earth and burrowing deeper and deeper. Or you can imagine roots spreading from the soles of your feet. Connect with your roots to the center of the earth. Or simply feel your roots spreading and feel the earth and the world around you. Open yourself to exchange energy. The earth can take what you need to let go of, and allow the earth to give you what you need. Visualize this energy as light moving back and forth.
Once grounded, (this is something you feel and know when you’re there) it is time to center. I visualize my branches reaching up into the sky to connect with the stars. Sometimes I imagine reaching up to Asgard. Rooted in the earth, connect to the sky.
Spend as much time as you need here. When done, visualize pulling your branches back in and pulling your roots up. Take a moment to visualize yourself back as a person to complete the work.
Definitely practice, and use what method works for you.