Solution 1:

In this post I worked out, as an exercise, the answer for smooth projective complex hypersurfaces, not using de Rham cohomology. After applying the Lefschetz hyperplane theorem, the basic tool is characteristic classes.

Solution 2:

There is a general algorithm for computation of (co)homology groups of real-algebraic subsets in $\mathbf{R}^n$. Being a hypersurface does not particularly help in this computation. The algorithm goes back to Tarski's work (on elimination of quantifiers).

The entire book Algorithms in Real Algebraic Geometry is pretty much all about such computations.

If you are dealing with complex projective varieties, then, in some range of dimensions, Lefschetz hyperplane theorem will allow you a dimension reduction. However, in the end of the day, you still have to do some dirty work (of algorithmic nature). See the book "Stratified Morse Theory", it is mostly about Lefschetz theorem in various forms. A good summary can be found here.