$Z = X - Y$
For independent random variables X and Y, the variance of their sum or difference is the sum of their variances
$\sigma^2_Z = \sigma^2_X + \sigma^2_Y$
$\sigma^2_Z = 1 + 2 = 3$
what "Z = X - Y" means?
let X be a random variable for a six sided die
$X = \{1,2,3,4,5,6 \}$
$E[X^2] = \large \frac{1}{6}$ $(1^2 + 2^2 + 3^2 + 4^2 + 5^2 + 6^2) = 15.166$
$E[X] = \large \frac{1}{6}$ $(1 + 2 + 3 + 4 + 5+ 6) = 3.5$
$(E[X])^2 = 3.5^2 = 12.25$
$\sigma^2_X = E[X^2] -(E[X])^2 = 15.166 - 12.25$
$\sigma^2_X = 2.916$
let Y be a random variable of a four sided die
$Y = \{1,2,3,4\}$
$\sigma^2_Y = 1.25$
All we know about X and Y are the variables which results in values which are in specific domain.
Both are independent random variables as we are throwing both die simultaneously so result of 1 die doesn't affect the result of other.
Now we introduce a dependent random variable $Z$ = X - Y
Z will depend on values of X and Y and will be equal to X - Y.
$Z =\{-3,-2,-1,0,1,2,3,4,5 \}$
$P(-3) = P(5) = \frac{1}{24}$
$P(-2) = P(4) = \frac{2}{24}$
$P(-1) = P(3) = \frac{3}{24}$
$P(2) = P(1) = P(0) = \frac{4}{24}$
$E[Z] $= 1
$E[Z^2]$ = $\frac{1}{24}\left(\left(-3\right)^{2}+5^{2}\right) +\frac{2}{24}\left(\left(-2\right)^{2}+4^{2}\right)+\frac{3}{24}\left(\left(-1\right)^{2}+3^{2}\right)+\frac{4}{24}\left(0^{2}+1^{2}+2^{2}\right) $
$ \large =\frac{34}{24}+\frac{40}{24}+\frac{30}{24}+\frac{20}{24} =\frac{124}{24}=\frac{31}{6} $$= 5.166$
$\sigma^2_Z = 5.166 - 1 = \color{blue}{4.166}$
Now let's find out if we are getting same answer by applying the identity.
$\sigma^2_Z = \sigma^2_X + \sigma^2_Y$
$\sigma^2_Z = 2.916 + 1.25 = \color{blue}{4.166}$
This was a not a proof but an insight on how independent random variables affect variances on subtraction. Now calculate variance of $Z'$ where $Z' = X + Y$. You'll get the answer $\color{blue}{4.166}$