Remove any loose plaster that's embedded in the crack. If it's a small hairline crack, you won't have to worry about this, but larger, deeper cracks will have debris in them that should be cleaned out.
Measure the length of the crack and cut strips of self-adhesive mesh drywall tape to the correct length.
Place the mesh tape directly over the crack and run your hand over it to stick it to the surface. The mesh tape should be centered over the crack.
Fill the mud pan with joint compound, then load the end of the 10-inch putty knife with a moderate amount of compound.
Place the 10-inch putty knife at one end of the mesh tape, so the left edge of the putty knife overlaps the taped area. With your index finger extended up at the center of the base of the handle, pull the putty knife down the crack, working from one end of the crack to the other. Use moderate pressure on the putty knife so you leave layer of joint compound that is no more than 1/8-inch thick. Repeat this on the right side of the crack, then make one more pass directly over the middle of the patched area.
Feather out the edges of the first coat while it is still wet by placing the putty knife on the left edge of the patched area. Extend your index finger up to the base of the handle with it placed left of center, then pull the putty knife down the patched area. Repeat this on the right side, this time with your index finger right of center on the handle. Allow the joint compound to dry overnight.
Apply a second coat of joint compound, following the same steps you used for the first coat, and allow it to dry.
Sand the patched area with fine-grit sandpaper. Use minimal pressure to prevent gouging the joint compound. Sanding will smooth out the patch and eliminate any high or low spots. As you're sanding, run your fingers along the area to test its smoothness. Sand until you're happy with the results.
Prime and paint the area. Paint fades over time, so if it's been a long time since the wall or ceiling has been painted, it will be nearly impossible to match the color for a seamless finish. You'll most likely need to repaint the entire wall or ceiling.