Brush away wood or concrete bits that have broken free inside the crack, using a small paintbrush. With a very narrow crack that won’t accommodate a small paintbrush, blow into the crack with canned air, aiming the air away from you to make sure you don’t get debris in your eyes.
Put a small amount of an appropriate filler, such as leveling compound for concrete doorways or wood filler for wood baseboards and doorways, on the tip of a putty knife. Smear the filler over the surface of the crack, starting at one end of the crack and spreading the filler toward the other end of the crack until the filler reaches the surface of the crack.
Let the filler dry in the crack in the baseboard or doorway for four to five hours. If the filler sinks deeper into the crack, leaving space at the surface, add more filler to the crack to make it level, and allow it another four to five hours to dry.
Use medium-grit sandpaper to sand the leveling compound or wood filler down until it feels level on the baseboard or doorway. Wipe the filler dust up with a tack cloth.
Cover the filler used in a wood baseboard or doorway with the same color paint used on the rest of the fixture. Use long strokes over the filled area, brushing a couple of inches beyond the crack at both ends to blend the fresh paint in with the surrounding paint as much as possible. Let the paint dry and use a second coat of paint if necessary to make the paint match the rest of the doorway or baseboard.