Another explanation for the equality $\mathrm{deg}(\omega_C) = -e(C)$, complementing that contained in Javier-Alvarez's MSE exposition linked by Francesco Polizzi, is *Hodge theory*. In short, Hodge theory gives an instance and a precise statement of how topological invariants are related to algebraic/holomorphic invariants. Specifically, Hodge theory tells you how to represent singular cochains as integrals with respect to holomorphic forms. More practically, Hodge theory expresses topological (singular) cohomology in terms of sheaf cohomology of $\mathcal{O}_C$ and $\Omega_C^1$.

But before I begin, let me clarify the setting in which I will be working in:

- My field will be $k = \mathbf{C}$, so that I can talk about topology.
- The symbol $C$ refers to the projective scheme over $\mathbf{C}$. I will write $C(\mathbf{C})$ to denote the Riemann surface associated with $C$.
- By "curve", I will mean "smooth projective curve over $\mathbf{C}$". Smoothness is required in general, as the relation $\mathrm{deg}(\omega_C) = -e(C)$ already fails for most nodal curves.

For a smooth projective curve $C$, Hodge theory (together with Serre's GAGA) says that there are canonical isomorphisms
\begin{align*}
H^0(C(\mathbf{C}),\mathbf{C}) & \cong H^0(C,\mathcal{O}_C), \\
H^1(C(\mathbf{C}),\mathbf{C}) & \cong H^1(C,\mathcal{O}_C) \oplus H^0(C,\Omega_C^1), \\
H^2(C(\mathbf{C}),\mathbf{C}) & \cong H^1(C,\Omega_C^1),
\end{align*}
where

- the cohomology groups on the left are the topological (singular) cohomology groups of the Riemann surface $C(\mathbf{C})$ with coefficients in $\mathbf{C}$;
- those on the right are sheaf cohomology groups computed on the scheme $C$; and
- $\Omega_C^1$ is the sheaf of Kähler differentials of $C$.

Thus we obtain the relation
\begin{align*}
e(C) & = \sum\nolimits_{i = 0}^2 (-1)^i \dim_{\mathbf{C}}(H^i(C(\mathbf{C},\mathbf{C})) \\
& = \sum\nolimits_{i = 0}^1 (-1)^i \dim_{\mathbf{C}}(H^i(C,\mathcal{O}_C))
- \sum\nolimits_{i = 0}^1 (-1)^i \dim_{\mathbf{C}}(H^i(C,\Omega_C^1)) \\
& = \chi(\mathcal{O}_C) - \chi(\Omega_C^1)
= -\mathrm{deg}(\Omega_C^1).
\end{align*}

Since $C$ is smooth, the dualizing sheaf can be explicitly determined: by, say, Hartshorne, *Algebraic Geometry*, Corollary III.7.12,
$\omega_C \cong \Omega_C^1$.
Putting this into the relation above gives
$$
\mathrm{deg}(\omega_C) = -e(C).
$$