OK, you've gone aground. I always say if you haven't gone aground you haven't gone anywhere. Typically, there is no need to panic (is there ever?). The first step is to check the state of the tide, if you don't already have it in your mind. If it is falling, you have to work quickly. On the other hand, maybe the tide is on the rise, where patience becomes a virtue.
Hopefully, you've chosen your cruising boat so that it has a hull shape and underbody that can take the ground with reasonable safety and without any major damage. I have been on a full-keel sailboat that piled up on solid rock--boulders actually--and managed to nestle down amongst them with no major damage. A sharp fin keel with exposed rudder and prop might not do so well. A catamaran can usually rest upright with little fuss.
Many feel an urgent need to call for a tow, with the likely prospect of a $1000 bill or more, and the potential for greater damage. I have witnessed many a boat get pulled off a grounding by powerful engines and lots of skill, but with inevitable damage, when simply waiting for the tide would have done nothing more than scrape off some bottom paint.
Yes, there are situations where the tide is falling, possibly the wind is driving you ashore, and maybe large waves are pounding your vessel. Maybe, that is the time to call for a tow, but keep in mind the inevitable cost and potential for disaster. Most of us try to avoid with extra care any close calls with the bottom when there is any hint of a dangerous wind or sea, so hopefully your grounding will be like most: in a sheltered spot where waiting for tidal help will suffice.
Of course, I would always make sure to put out an anchor in the direction of deep water to both help pull the boat off when the tide rises, and also as insurance in case the prop is fouled or damaged. You may be surprised how much power you can generate with a well dug in anchor leading back to a powerful windlass and/or cockpit winches. I have literally dragged my boat back into deep water when the engine wouldn't budge her. Sometimes, all it takes is a little steering with the anchor line to get the boat pointed in the right direction. And, other times, the best route out is backwards, with the anchor line leading off the stern.
Having a dinghy handy with a portable depth sounder can be a great help. My dinghy has long oars that allow me to poke around and find deep water quickly. A boat hook or even a mop handle can do the same. You don't need lots of extra water--just enough to float your boat.
A tow should be your last resort, whether by your own dinghy or someone else's boat. Chances are that most of us don't have cleats strong enough for the strains of a serious tow, and rigging extra lines and such is time consuming if you are in a rush. Heed the first paragraph--a falling tide means you need to work fast. Sometimes all you need is a lightweight anchor that can be taken out quickly in a dinghy, and you can be back afloat in five minutes. I have performed this maneuver many times when my own engine wasn't enough.
Some people recommend hauling a sailboat over using a halyard as a way to reduce draft. In my experience this is both very difficult to achieve and also likely to break something, and often fails too--a trifecta of hopelessness! First, you need a big powerful tow boat to heel your boat over, and it has to be shallow draft and on scene. All of those things are unlikely to be present. And then you need a very strong halyard and mast, and hope it doesn't jump the masthead sheeve and jam permanently, if it doesn't break first. This all assumes that you can arrange everything quickly enough to avoid the falling tide--if the tide is rising, why bother? Of course, this idea doesn't work at all if you have a catamaran or powerboat.
A grounding is a situation where your first actions need to be swift, deliberate, and appropriate to the particular set of circumstances. Calling for a tow is usually not the first, second, or third option that should be tried. Good luck!