Let $C$ be a smooth projective curve of genus $g$, we know that for a general line bundle $\mathcal{L}$ of degree $g-1$, $\mathcal{L}$ has no global sections, i.e. $\text{H}^0(C, \mathcal{L})=0$.
My question is that, in some particular case, for example, $C$ is a plane algebraic curve and I know the defining equation of $C$, How can I explicitly find such a line bundle $\mathcal{L}$? By explicitly I mean to find points on $C$ and write down the divisor form of $\mathcal{L}$.
Or if I pick a divisor of $C$ randomly, for example, divisors of the form $D=p_1+\cdots + p_g-q$, do I have a criterion to determine whether $\text{H}^0(C, \mathcal{O}_C(D))=0$?