Sunlight is the best way; it's best to try to get around 10-15 minutes without sunscreen (but no longer without sunscreen) if possible on the average day. However, if you're vitamin D deficient, you will probably need to look into a supplement.
The best option is to get sunlight which provides you vitamin D. But if it is not possible to get sunlight then you can include fatty fish, some type of orange juice, egg yolks etc. in your diet because they are convenient way to get Vitamin D.
The natural way to get it is through the sun. Also, fortified milk and orange juice contain Vitamin D (as do sardines and salmon).