If we consider
$$\int_{0}^{\infty} \frac{dx}{1+x^2}$$
Using complex contour integration only.
We choose a contour in the TOP HALF plane.
From the poles $z = \pm i$ only, the pole: $z=i$ is inside the contour.
Are we **still considering ** the pole $z= -i$
But, is the residue of $z=-i$ = 0? Because it is outside the contour??
Bottomline: Why do we only have to consider the pole inside the contour rather than outside? How does that give the actual integral?
You don't have to pay attention to any poles outside the contour. The residue at $-i$ is not zero, but it doesn't contribute because only poles inside the contour contribute. (This all assumes no poles are on the contour itself.)
There are plenty of proofs of the residue theorem, so you can look them up yourself.