Step 1: Basis of phenol acidity.
Acidity depends on the stability of the phenoxide anion after losing $H^+$. A more stable phenoxide means higher acidity.
Step 2: Effect of $-NO_2$ at ortho position.
The $-NO_2$ group withdraws electrons both inductively ($-I$) and by resonance ($-M$). It delocalises the negative charge of the phenoxide ion onto the electronegative oxygen atoms of $-NO_2$, greatly stabilising the anion. A more stable anion means greater acidity.
Step 3: Effect of $-OCH_3$ at ortho position.
The $-OCH_3$ group donates electrons by resonance ($+M$ effect), increasing electron density on the phenoxide oxygen, destabilising the already negative anion. A less stable anion means lower acidity.
Step 4: Conclusion.
$-NO_2$ stabilises phenoxide (increases acidity) while $-OCH_3$ destabilises it (decreases acidity). Therefore o-nitrophenol is more acidic than o-methoxyphenol.