The results indicated that in females, SPISE (OR: 0.572, 95% CI 0.477–0.687), VFA (OR: 1.009, 95% CI 1.001–1.017), FPG (OR: 1.059, 95% CI 1.002–1.120), DBP (OR: 1.026, 95% CI 1.006–1.046), UA (OR: 1.005, 95% CI 1.002–1.008), TC (OR: 1.236, 95% CI 1.036–1.475), and Scr (OR: 0.973, 95% CI 0.958–0.988) were independently associated with NAFLD, while in males, SPISE (OR: 0.737, 95% CI 0.587–0.926), VFA (OR: 1.013, 95% CI 1.005–1.021), diabetes duration (OR: 0.940, 95% CI 0.903–0.978), Hb (OR: 1.030, 95% CI 1.013–1.047), and GGT (OR: 1.009, 95% CI 1.002–1.016) were independently related to NAFLD. Here, GSTM1 is linked to metabolic dysfunction-associated steatotic liver disease.