Another more recent trial (TARGET-D) is showing a 52% reduction in heart attack risk: https://www.empirical.health/blog/vitamin-d-heart/
That trial used a dynamically-adjusted dosage of a vitamin D3 supplement, where dosing was set as to keep blood levels within a target range of 40–80 ng/mL. IMO part of the reason this trial is showing better results than the previous clinical trials of vitamin D supplementation quoted in the above article is that vitamin D has bad effects if too low and too high. Adjusting the dose dynamically to achieve an optimal range gets you the benefits without some of the negative effects.