Let $X_1$ be the amount of dollars you win if the first coin comes up tails: $-1$
There’s a 50/50 chance of it landing tails
$ Pr(X_1 = -1) = \frac{1}{2} $
Let $X_2$ be the amount of dollars you win if the second coin comes up heads: $2$
There’s a 50/50 chance of it landing heads
$ Pr(X_2 = 2) = \frac{1}{2} $
$ E(X) = (-1) \cdot Pr(X_1 = -1) + 2 \cdot Pr(X_2 = 2) $
$ E(X) = (-1) \cdot \frac{1}{2} + 2 \cdot \frac{1}{2} $
$ E(X) = -\frac{1}{2} + 1 $
$ E(X) = \frac{1}{2} $