One tried and true method for fixing gaps is filler. There are technical distinctions between fillers and putties, and dozens of commercial products with different properties are available, but for our purposes we will stick to a few simple options.
Durham's Rock Hard Water Putty is easy to use, dries hard and can be sanded, and doesn't shrink. It has a white appearance and will show under stain or clear finish, but is excellent for projects that will be painted.
Another classic is to mix sawdust and glue to make your own filler matched to your project. Different glues and mix ratios give different results.
Fillers, top to bottom:
Durham's Rock Hard Water Putty
Wood patch, matching species and grain orientation
White glue (PVA) and sawdust mixture
Yellow glue (wood glue) and sawdust mixture
Super glue and sawdust mixture
Epoxy and sawdust mixture
Stain and finish on top of fillers:
Left side: clear polyurethane finish
Middle: raw cherry, no finish
Right side: wood stain (color = walnut)
Sometimes the best option for a repair is a solid wood patch or plug. By matching the species, grain, and orientation to the patch of the surrounding wood, this kind of fix can be nearly invisible--or choose contrasting material to make it stand out.
Use a tool called a plug cutter to make face-grain plugs that match the area to be repaired--or to cover screw holes. Glue and hammer the plugs in place, then saw and sand them flush after the glue dries.
To make a Dutchman repair, cut out a patch of the desired size and shape, carefully knife its outline over the damaged area, use a chisel to chop out a pocket, glue the patch in place, and sand it level after the glue dries. Some designers, like Siosi, make this a signature look.
Depending on the gap that needs repair, you can use a chisel to make a wedge, splinter, strip, or any desired shape to glue into a void. Allow the glue to dry, then saw and sand flush.
If the wood fibers have only been compressed but not torn, judicious application of steam can sometimes cause them to swell back to their original position. Soak a 100% cotton rag in water, then use a regular household iron to thoroughly heat the area. Allow the wood to dry completely, then sand to level as needed.
This trendy method is a good way to fill knotholes so they don't collect dirt and grime. Fill the knothole slightly above level, allow to cure, then scrape and sand level. Epoxy can be tinted to different colors as desired.
Burn-in sticks are solid bars of material (often shellac or a similar resin) that come in various colors to match different wood finishes. They are designed to be melted and used as a filler for imperfections in wood--usually after stain and finish are applied.