What does (the point at infinity) even mean?
That's an abstract point/concept required so that the addition of points on the Elliptic Curve is a group law, including
- Addition of any two elements $P$ and $Q$ of the group is an element of the group
- There is a neutral element $\mathcal O$ such that for all $P$, $P+\mathcal O=P=\mathcal O+P$.
A possible definition: the point at infinity is a single extra element $\mathcal O$ added to the curve and the rules of point addition, such that for all $P$ on the curve (including the point at infinity $\mathcal O$), it holds $P+\mathcal O=P=\mathcal O+P$.
We can then define $-P$ as the point $Q$ such that $P+Q=\mathcal O=Q+P$, and for all $P$ it holds $P+(-P)=\mathcal O=(-P)+P$.
How to calculate (the point at infinity)
One does not, much like one does not calculate $+\infty$.
One may define a conventional representation of the point at infinity in the Cartesian coordinate system by picking any coordinate not on the curve, e.g. $(x,y)=(0,0)$ assuming $b\ne0$. With this convention, a point $(x,y)$ is on the curve if $(x,y)=(0,0)$ or if $y^2 = x^3 +a x + b$. And the addition law is extended as
$$(x_0,y_0)+(x_1,y_1)=\begin{cases}
(0,0)&\text{ if }(x_0,y_0)=(x_1,-y_1)\\
(x_0,y_0)&\text{ if }(x_1,y_1)=(0,0)\\
(x_1,y_1)&\text{ if }(x_0,y_0)=(0,0)\\
\text{per usual rules }&\text{ otherwise}
\end{cases}$$
As noted in this comment, the point at infinity has a more natural representation in projective coordinates.
A correct implementation of point addition should give a representation of the point at infinity $\mathcal O$ when asked to compute $P+(-P)$ for $P$ any point on the curve. Note that in Cartesian coordinates, if $P=(x,y)$ and $P\ne\mathcal O$, then $-P=(x,-y)$ or $-P=(x,(p-y)\bmod p)$ depending on conventions. The representation of $\mathcal O$ is not necessarily unique, therefore $P+(-P)=Q+(-Q)$ does not necessarily hold.