Yes, this is the way to do it.
But the problem is stated a little imprecisely. You should write something like: "Let the random variable $X$ be the number that appears on the selected ball. Find the variance and standard deviation of $X$".
The variance of a random variable $X$, denoted by $\sigma^2_{ X}$, can be calculated using the formula $ \sigma^2_X=\Bbb E(X^2)-[\Bbb E(X)]^2;$
which, in the discrete case, gives $\sigma^2_X=\sum_i x_i^2 p_X(x_i) -\bigl[\,\sum_i x_i p_X(x_i) \,\bigr]^2 $ where $p_X$ is the probability mass function of $X$ and the $x_i$ are the distinct values that $X$ takes.
In your problem, as you state, $X$ takes the values $0, 2, 4, 6, 8$ with equal probabilities $1/5$. So, $p_X(i)=1/5$ for $i=0,2,4,6, 8$, and: $ \sigma_X^2= \sum_{i\in\{0,2,4,6,8\}} i^2\cdot{\textstyle{1\over 5}} - \Bigl[ \sum_{i\in\{0,2,4,6,8\}} i \cdot{\textstyle{1\over 5}}\Bigr]^2. $
I'll leave the actual computation to you.
Of course, the standard deviation of $X$ is just the square root of the variance.