They go together like a horse and carriage.
First, we need cholesterol in our bodies. Then we need the sun to convert this cholesterol into Vitamin D. Vitamin D is a hormone that helps to regulate the amount of minerals in our bodies and is therefore important for (among other things) bone and muscle health.
It may also help to improve conditions like depression and anxiety. Another reason for it to be called the "sunshine vitamin".
30 minutes of sun exposure for people with fair skins (without sunscreen,) can produce enough vitamin D to support all their body's needs. Darker people have more melanin in their skins, and since melanin decreases the production of vitamin D, they will need more time in the sun for the same result to be created.
Moderation is once again the key here. Handle your sun exposure with care to avoid sunburn or premature ageing of the skin. I am an advocate for the use of good quality, but I also like to be aware of how I can get my vitamin D the natural way.
A compromise?: Sunscreen needs to be applied 30 minutes before sun exposure. This allows for the filters to become effective. Could you perhaps use this window period for your natural vitamin D synthesis? You decide.
Take-home thought: Lots of sunshine and cholesterol-rich food are not all bad news. However, if you are on a low-cholesterol diet and/or always use sunscreen, you may want to consider taking a good vitamin D supplement.
You can't have one without the other.