Even though quite a bit has been said already, i wanted to add something.

The numbers which you normally use in school (-1, $\frac{2}{3}$, $ \pi$, etcetera) are called the real numbers. The set of real numbers is denoted by $\mathbb{R}$.

Now the square root of any number $b$ is normally considered to be any number $x$ that satisfies $x^2 = b$, or equivalently $x^2 - b = 0$.

As you pointed out, there are normally two solutions to this, so two values for $x$ will do the trick. However, working in $\mathbb{R}$ this situation is remedied by adopting the convention that the square root of $b$ will be the positive number $x$ that satisfies $x^2 - b=0$. So indeed, when $b= a^2$, we get
$$
\sqrt{a^2} = |a|.
$$
So with this convention, the solutions to $x^2 - b=0$ become $x=\sqrt{b}$ and $x = -\sqrt{b}$. It is very important to note that this is merely a convention.

Even more: there are more sets of numbers we could work in, where this trick will not work! If we pass from the real numbers $\mathbb{R}$ to the so called complex numbers, denoted $\mathbb{C}$ (check wikipedia), we lose this! In this set of numbers, the notion of a positive number does not make sense, and it is in fact impossible to define a square root function in a nice way on the whole of $\mathbb{C}$ (if you want to know more about this, ask google).

In general there are many more things that i call "sets of numbers" now, in mathematics they are called "fields". In all of them, the square root notion makes sense, as in solving the solution to $x^2 - b=0$. However, the nice $\sqrt{{}}$ function as we have it in $\mathbb{R}$ is rarely found in other fields.