Although you can still ride the bike with a broken gear cable, it puts you in your smallest chain ring or your hardest rear gear (unless you have Shimano Rapid Rise, in which case you end up in your easiest rear gear).
To adjust the gear that you are in, but without restoring shifting capability, use the High and Low swing adjustment screws to move the derailleur across. On the front derailleur, you should be able to move the chain into the middle chain ring. On the back derailleur, you may get two or three gears’ worth of adjustment.
If you need a bigger adjustment, pull the cable out from the shifter body on the handlebar so that you have the piece with a “bead” on it. Remove the cable housing from the derailleur, and then thread the cable through the derailleur so that the “bead” on the end of the cable sits in the adjuster barrel of the derailleur.
Tighten the cable in place with the derailleur in the gear you want. The adjuster barrel gives you precise control (except on the SRAM X0 and Shimano XTR derailleurs, which give these adjusters up for weight savings).
A faster, messier alternative is to stuff a stick into the parallelogram mechanism of the derailleur so that it is held in the correct position for the required gear. However, sticks of the right thickness and strength aren’t always available.