The coiling up of DNA with the help of histone proteins - to what is called heterochromatic regions- is part of gene regulation. This makes genes inaccessible to RNA polymerase that makes mRNA from the genes. When the genes are exposed by DNA unwinding, these genes are transcribed and the resulting mRNAs are translated by ribosomes into proteins.
The DNA never unwinds completely, but rather does so region by region, because if it does so it would become so long that it wouldn't fit in the nucleus or cell.