Given a smooth affine variety $X$ defined over $\mathbb{Q}$, its singular cohomology is isomorphic to the algebraic de Rham cohomology, which is the cohomology of the complex $\Omega_X^0\to\Omega_X^1\to\dots$ of differential forms on $X$ with polynomial coefficients. If $X$ is given by equations $f_1,\ldots,f_m\in\mathbb{Q}[x_1,\ldots,x_n]$ then the algebra of differential forms has the following explicit presentation: $$ \Omega_X^* = \mathbb{Q}[x_1,\ldots,x_n,d x_1,\ldots,d x_n]/(f_1,\ldots,f_m,d f_1,\ldots, d f_m), $$ and the differential $d$ is defined in the obvious way. So the problem of computing the cohomology of $X$ is reduced to the problem of computing the cohomology of the explicitly presented (super-)commutative dg algebra above.

It is not clear if there is a general algorithm for computing the cohomology of a finitely presented commutative dg algebra. I suspect there is none. On the other hand, the de Rham complex can be interpreted as the complex representing the derived push-forward $R^* \pi_* O_X$, where $\pi:\mathbb{Q}^n\to \mathrm{point}$ is the projection. There is an algorithm to compute this kind of push-forwards, it basically relies on the notion of a complex of D-modules with holonomic cohomology: the D-module $O_X$ is holonomic, and the push-forward of such a complex is again such a complex. The push-forward is computed by successively applying the push-forwards via $$ \mathbb{Q}^n\to\mathbb{Q}^{n-1}\to\mathbb{Q}^{n-2}\to\dots\to \mathrm{point}. $$

For details, see this paper and other papers by these authors and references therein:

*Oaku, Toshinori; Takayama, Nobuki*, **An algorithm for de Rham cohomology groups of the complement of an affine variety via (D)-module computation**, J. Pure Appl. Algebra 139, No. 1-3, 201-233 (1999). ZBL0960.14008.

**The question is:** what makes the dg algebra $\Omega^*_X$ so special that its cohomology can be computed? Is there a notion of a 'nice' dg algebra so that 1) all dg-algebras of the form $\Omega^*_X$ are nice and 2) there is an algorithm for computing the cohomology of a nice dg-algebra?