A dry socket occurs when the blood clot at the extraction site is dislodged or dissolves, exposing the bone and nerves, leading to severe pain. To prevent dry socket, avoid drinking through a straw, smoking, and spitting forcefully for at least a week after the extraction.