Why is $h^1(S,\mathcal{O}_S(-D))=h^0(D,\mathcal{O}_D)-1$ on a $K3$ surface? Let $D$ be a divisor on a $K3$ surface $S$. We have an exact sequence :
$\qquad\qquad\qquad\qquad\qquad0\longrightarrow\mathcal{O}_S(-D)\longrightarrow\mathcal{O}_S\longrightarrow\mathcal{O}_D\longrightarrow 0$.
We therefore get the long exact sequence $0\longrightarrow H^0(\mathcal{O}_S(-D))\longrightarrow H^0(\mathcal{O}_S)\longrightarrow H^0(\mathcal{O}_D)\longrightarrow H^1(\mathcal{O}_S(-D))\longrightarrow H^1(\mathcal{O}_S)\longrightarrow\cdots$.
Since $S$ is a $K3$ surface, we have $H^1(\mathcal{O}_S)=0$. Therefore, we get
$h^0(\mathcal{O}_S(-D))-h^0(\mathcal{O}_S)+h^0(\mathcal{O}_D)-h^1(\mathcal{O}_S(-D))=0$. We know that $h^0(\mathcal{O}_S)=1$. Therefore, we just need to prove that $h^0(\mathcal{O}_S(-D))=0$. Why is this true? I am not able to see it. Thanks in advance!

Presumably you are assuming that $D$ is effective. Then a section of $\mathcal{O}_S(-D)$ is a function with no poles which vanishes along $D$; such a function is identically zero as a K3 surface is projective.
