Concept:
Two matrices are equal if all their corresponding elements are equal.
Step 1: Compare corresponding elements of both matrices.
\[
\begin{bmatrix}
x+y & 2
1 & x-y
\end{bmatrix}
=
\begin{bmatrix}
4 & 2
1 & 2
\end{bmatrix}
\]
From the first row and first column:
\[
x+y=4 \quad \cdots (1)
\]
From the second row and second column:
\[
x-y=2 \quad \cdots (2)
\]
Step 2: Add equations (1) and (2).
\[
(x+y)+(x-y)=4+2
\]
\[
2x=6
\]
\[
x=3
\]
Step 3: Substitute \(x=3\) in equation (1).
\[
3+y=4
\]
\[
y=1
\]
Therefore,
\[
\boxed{x=3,\ y=1}
\]