Variance
Var(X) = E[X^2] - E[X]^2.
The idea
The variance of a random variable measures how far its values spread around its mean. The mean alone says nothing about spread: two random variables can both have mean $0$ while one never leaves $[-1, 1]$ and the other swings between $-1000$ and $1000$.
To measure spread, consider the deviation $X - \mu$ from the mean $\mu = \mathbb{E}[X]$. Its average is $0$ for every random variable, because the mean is exactly the point where the positive and negative deviations cancel. Squaring the deviation first removes the cancellation, and it also weights large departures more heavily: a departure twice as large counts four times as much.
Definition (Variance).
The variance of a random variable $X$ with mean $\mu = \mathbb{E}[X]$ is its mean squared deviation, $\mathrm{Var}(X) = \mathbb{E}\big[(X - \mu)^{2}\big].$
It is never negative, and it equals $0$ exactly when $X$ is constant. Because it is built from squares, its units are the square of $X