We now have an RCT for megadoses of vitamin D as treatment for diagnosed cases of COVID-19 infection. According to Chris Masterjohn's summary:
50% of the control group (13 people) required admission to the ICU. Only 2% of those in the vitamin D group (one person) required admission to the ICU.
The study used megadoses of a special more active form of vitamin D. Quoting again from Masterjohn's summary:
The vitamin D was provided as oral calcifediol, also known as calcidiol, 25(OH)D, and 25-hydroxyvitamin D. [...] 25(OH)D [...] is five times as potent as vitamin D [...] Whereas one microgram (mcg) of vitamin D is 40 IU, 1 mcg of 25(OH)D is 200 IU.
Megadoses may have been needed because these were already-infected people with what's effectively a preexisting condition of vitamin D deficiency. As a prophylactic, ordinary vitamin D in doses of a few thousand IU per day is most likely sufficient. I use NOW vitamin D gel caps, and also take extended outdoor walks most days.
At this point I'm no longer worried about COVID personally, though I'll keep cooperating with public safety efforts to wear masks in public, in part because this sort of prosocial signaling is likely to be helpful if we get a worse plague sometime.
Related: Covid 9/10: Vitamin D