Use the Right Spackling Paste
For repairs to a cracked ceiling, be sure the spackling compound is intended for interior use. Exterior spackling paste is designed to be used on such materials as wood, stucco and masonry, not the drywall used for an interior ceiling. The spackling paste may also be labeled interior/exterior, which you can also use.
Level the Crack
Avoid the appearance of an imperfect ceiling by filling in the ceiling crack with enough spackling paste so that it is level with the rest of the ceiling. Before applying the paste, smooth out the imperfections around the crack perimeter with fine-grade sandpaper. Completely fill in the crack with a putty knife. Feather the edges out with the putty knife so that it flows smoothly with the rest of the ceiling surface. If the crack or dent is small enough, you can simply scoop out a small amount of spackling paste with your finger to fill in the recess.
Any time you work on a ceiling, you will be looking up. While spackling, protect yourself by wearing the appropriate eye protection, especially when you are smoothing out the edges of the ceiling crack before you apply the spackling paste. Eye protection also protects you from the any compound dripping off the putty knife or your finger into your eyes. Wear a dust mask while sanding.
For Larger Cracks
If the ceiling crack is large, simply filling the crack with spackling compound will likely not provide a permanent solution. Apply spackling paste then center drywall tape over the crack and smooth the spackling out with a putty knife. Apply a second coat of spackling paste and allow it to dry. Once it dries, you will likely need a final coat of paste. Once that coat dries, often in minutes, sand the patch lightly so that it matches the rest of the ceiling surface. Some spackling compounds do not require that you prime the spackling patch before painting; but if that is not the case, apply primer to the repaired area and paint it to match the rest of the ceiling.