Suppose $Y$ is a smooth hypersurface in projective space $\mathbb{P}^n$, $X = \mathbb{P}^n - Y$ is the hypersurface complement. Is there a general method to compute cohomology of $X$? In particular, for small n, is there any examples or references?



Cohomology of Hypersurface complement
This is **very** computable, using several methods. I assume you are over $\mathbb{C}$ and
that by cohomology
you mean singular cohomology, but other choices are also just as straight forward.
Let $P=\mathbb{P}^n$.
Then by the Gysin sequence
$$ \ldots H^i(P)\to H^i(X)\to H^{i-1}(Y)\to H^{i+1}(P)\ldots $$
you can basically reduce it to the computation of $H^i(P)$, which is standard, and
$H^i(Y)$. 
There are a number of explicit formulas for the latter. See, for example,
 <http://www.math.purdue.edu/~dvb/preprints/book-chap17.pdf>


**Notes**: The connecting map $H^{i-1}(Y)\to H^{i+1}(P)$ is the Gysin map, which is Poincaré dual
to the restriction $H^{2n-i-1}(P)\to H^{2n-i-1}(Y)$. Alternately, choose a tubular neighbourhood
$Y\subset T\subset P$ and 
identify 
$$H^{i-1}(Y)= H^{i-1}(T) = H^i(T,\partial T)=H^{i}(P,X)$$ 
by excision and the Thom isomorphism. Then this is the usual connecting map, and the
sequence is long exact sequence for the pair $(P,X)$. There other ways to understand
this as well.


