Another way of looking at this is to use the fact that a symmetric bilinear form $B\colon V\times V \to \mathsf k$ gives a linear map $\theta\colon V \to V^*$ by setting $\theta_B(v)\in V^*$ to be the functional $\theta(v)(w) = B(v,w)$. In the case where $V$ is a Lie algebra $\mathfrak{g}$, and the symmetric bilinear form $B$ is invariant, then a straight-forward computation shows that $\theta_B\colon \mathfrak g \to \mathfrak g^*$ is an homomorphism of $\mathfrak g$-representations.
Write $\mathfrak g$ (or $\mathfrak g(\mathsf k)$ if we need to be clear which field we are using) for $\mathfrak{sl}_2(\mathsf k)$.
The Lie algebra $\mathfrak g(\mathsf k)$ is simple, or equivalently the adjoint representation is irreducible, whenever $\mathsf k$ has characteristic not equal to $2$. To see this, suppose that $I$ is an ideal in $\mathfrak{sl}_2(\mathsf k)$ and $I\neq 0$, then we may pick $a \in I\backslash \{0\}$. Write $a = \lambda_1X+\lambda_2 Y +\lambda_3H$.
Then
\begin{equation}
\begin{split}
[X,[H,a]] = [X,2\lambda_1X -2\lambda_2Y] = -2\lambda_2H,\\
[H,[X,a]] =[H, \lambda_2H - 2\lambda_3X] = -4\lambda_3X, \\
[Y,[H,a]] = Y,2\lambda_1X-2\lambda_2Y] = -2\lambda_1H.
\end{split}
\end{equation}
Since at least one of $\lambda_1,\lambda_2,\lambda_3\neq 0$, we must have either $H \in I$ or $X\in I$. But then it is easy to see from the identities $[X,Y]=H, [H,X]=2X$ and $[H,Y]=-2Y$ that if $X$ or $H$ lie in $I$, then all of $X,Y,H$ lie in $I$ so that $I =\mathfrak{sl}_2(\mathsf k)$ and $\mathfrak{sl}_2(\mathsf k)$ is simple as required. (Note that it is the appearance of $2$ in the relations $[H,X]=2X$ and $[H,Y]=-2Y$ which make characteristic $2$ an exception. See below for more on that case.)
Now since $\mathfrak g(\mathsf k)$ is simple, Schur's Lemma shows that $D=\text{Hom}_{\mathfrak g}(\mathfrak g, \mathfrak g^*)$ is a division algebra. Since the only division algebra over an algebraically closed field is the field itself, this means that if $\mathsf k$ is algebraically closed, the space of invariant bilinear forms is at most $1$-dimensional.
In fact because we know $\mathfrak{sl}_2(F)$ is simple for any field $F$ of characteristic different from $2$ (and so in particular for $\bar{\mathsf k}$ if $\text{char}(\mathsf k)\neq 2$) this bound holds for any such $\mathsf k$. Indeed $\bar{\mathsf k}\otimes_{\mathsf k} D \cong \bar{\mathsf k}^d$ were $d = \dim_{\mathsf k}(D)$ and $\bar{\mathsf k}\otimes_{\mathsf k}\mathfrak g = \mathfrak g(\bar{\mathsf k}) = \mathfrak{sl}_2(\bar{\mathsf k})$. But then
$$
\bar{\mathsf k}^d = \bar{\mathsf k}\otimes_{\mathsf k}D =
\bar{\mathsf k}\otimes \text{Hom}_{\mathfrak g}(\mathfrak g,\mathfrak g^*) \subseteq \text{Hom}_{\mathfrak g(\bar{\mathsf k})}(\mathfrak g(\bar{\mathsf k}), \mathfrak g(\bar{\mathsf k})^*)
$$
and the space $\text{Hom}_{\mathfrak g(\bar{\mathsf k})}(\mathfrak g(\bar{\mathsf k}), \mathfrak g(\bar{\mathsf k})^*)$ is at most one-dimensional since $\bar{\mathsf k}$ is algebraically closed, so $d\leq 1$.
Since the trace form $t_{\mathfrak{sl}_2}(x,y) = \text{tr}(xy)$ is readily checked to be a nonzero invariant symmetric bilinear form, the space of all symmetric invariant bilinear forms must be $\mathsf k.t_{\mathfrak{sl}_2}$ and moreover it also follows that $t_{\mathfrak{sl}_2}$ is nondegenerate! (This can be checked directly from the explicit calcuation of $t_{\mathfrak{sl}_2}$ in John Doe's answer.)
If $\text{char}(\mathsf k)=2$, the story is completely different: in that case $[H,X]=0, [H,Y]=0$ and $[X,Y] = Z$, so that $\text{span}_{\mathsf k}\{H\}=D(\mathfrak{sl}_2(\mathsf k)) = \mathfrak z(\mathfrak{sl}_2(\mathsf k))$, and so $\mathfrak{sl}_2(\mathsf k)$ is no longer simple. In fact $\mathfrak{sl}_2(\mathsf k) \cong \mathfrak n_3(\mathsf k)$ where $\mathfrak n_3(\mathsf k)$ is the space of strictly upper-triangular $3$-by-$3$ matrices over $\mathsf k$, the smallest nonabelian nilpotent Lie algebra over $\mathsf k$.
Moreover, it is easy to see that the trace form $t_{\mathfrak{sl}_2}$ is now degenerate, because in characteristic 2 $I_2=H \in\mathfrak{sl}_2(\mathsf k)$ and $t_{\mathfrak{sl}_2}(I_2,a)=\text{tr}(I_2.a)=\text{tr}(a)=0$ for all $a \in \mathfrak{sl}_2(\mathsf k)$ (and in fact $\mathsf k.I_2$ is the radical of $t_{\mathfrak{sl}_2}$ as again you can check by explicit calculation). Indeed it is easy enough to check that $\mathfrak{sl}_2(\mathsf k)$ and its dual $\mathfrak{sl}_2(\mathsf k)^*$ are not in fact isomorphic as $\mathfrak{sl}_2(\mathsf k)$-representations, and so that there are no nondegenerate symmetric bilinear forms on $\mathfrak{sl}_2(\mathsf k)$ in this case. On the other hand, the space of invariant bilinear forms, or equivalently the space $\text{Hom}_{\mathfrak{g}}(\mathfrak g,\mathfrak g^*)$ is now $4$-dimensional! If we write $\{\delta_X,\delta_H,\delta_Y\}$ for the basis of $\mathfrak g^*$ dual to $\{X,H,Y\}$, then the invariant bilinear forms are spanned by $\text{span}\{\delta_X.\delta_X,\delta_X.\delta_Y,\delta_Y.\delta_X,\delta_Y.\delta_Y \in \{X,Y\}\}$, where $\delta_a.\delta_b$ denotes the bilinear map $(x,y)\mapsto \delta_a(x).\delta_b(y)$. The trace form $t_{\mathfrak{sl}_2}$ is just $\delta_X.\delta_Y + \delta_Y.\delta_X$. Note that it is invariant symmetric bilinear form which is not alternating. (In characteristic $2$, symmetric and skew-symmetric mean the same thing, but the alternating condition is strictly stronger.)
I can't help adding a general remark about invariant bilinear forms: the notion of an "invariant" bilinear form is often introduced as the condition that $B([x,y],z) = B(x,[y,z])$ without explanation (or worse, it is called "associativity") but it is just the usual notion of invariance, i.e. that the span of $B$ gives a copy of the trivial representation: Bilinear forms on a $\mathfrak g$-representation $V$ have the structure of a $\mathfrak g$-representation because they can be identified with the space $(V\otimes V)^*$. The calculation that checks that $\theta_B$ is a homomorphism of $\mathfrak g$-representations if $B$ is invariant in fact shows that the map $B \mapsto \theta_B$ from bilinear forms on $V$ to $\text{Hom}_{\mathsf k}(V,V^*)$ is a homomorphism of $\mathfrak g$-representations, which makes it clear why this works -- the calculation reduces to the one for $\mathfrak{gl}_V$ acting on $V$ and in that case it follows from the fact that the identification of the space of bilinear forms with $\text{Hom}(V,V^*)$ is functorial.