How to construct line bundles of degree $g-1$ on smooth projective curve with no global section? 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$?

I will assume that $C$ is a smooth plane curve of degree $d$. Let $C'$ be a general curve of degree $d-3$ so that the intersection
$$
C \cap C' = \{P_1,\dots,P_{d(d-3)}\}
$$
is transverse. Note that $d(d-3) = 2g - 2$ by adjunction. Choose $g$ points out of $P_i$ such that $C'$ is the only curve of degree $d-3$ passing through them. Assume these are points $P_1,\dots,P_g$. Then for any point $Q \not\in\{P_1, \dots, P_g\}$ the divisor class $P_1 + \dots + P_g - Q$ has no cohomology.
