After adjusting for age, gender, and metabolic measures, we identified that CYP24A1 rs2296241 variant genotypes (recessive model: OR, 1.316; 95% CI, 1.048–1.653; p = 0.018), rs2248359 variant genotypes (recessive model: OR, 1.315; 95% CI, 1.033–1.674; p = 0.026), and CYP27B1 rs4646536 variant genotypes (additive model: OR, 1.147; 95% CI, 1.005–1.310; p = 0.042) were associated with an elevated risk of NAFLD. This evidence concerns the gene CYP24A1 and metabolic dysfunction-associated steatotic liver disease.