Why do you need vitamin D and how can you get enough of it?

Why do you need vitamin D and how can you get enough of it?