The general steps involve lysing the cells (breaking the cell membrane) in order to get a mix of nucleic acids (some of which you want), sugars, proteins, lipids, and other detritus (which you don't want). Then you separate out this mix with a series of steps of washing, spinning down with a centrifuge, and extraction.
A DNA extraction kit is involved. Here's one from Qiagen, for example. A kit usually contains a mix of salts and buffers specific to the source of DNA, to get as much pure sample back as you can.
You might not start with much DNA, so picking the right kit can help you get back a high enough yield of genetic material to do other experiments.
Kits are often based on ethanol or isopropanol, which precipitates out the DNA from the rest of the gunk. You add some buffer and run it through the centrifuge, removing and discarding what is on top (the "supernatant"). After repeated wash and spin steps, what's left is mostly purified DNA, in visible pellet form.
As a specific example, here is a paper that describes one approach to isolate DNA from human sperm, with a detailed protocol: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4486329/