Explanation:
let's solve it by eliminating method
first we will eliminate x by using first and second equation
multiply second equation by -2
-2 × (x+3y+z) = 8 ➡ -2x -6y-2z = -16
now add it up to first equation
2x-2y+4z -2x-6y-2z = 2 -16 ➡ 2z -8y = -14
now using thus new equation with 3rd one to get rid of z
multiply 3rd equation by 2
2 × (3y-z) = 5 ➡ 6y -2z = 10
add this to the new equation we found
6y -2z + 2z -8y = 10 -14 ➡
y = 2
now use y to find the value of z in the 3rd equation
3×2 -z = 5
z = 1
lastly
x + 3×2 + 1 = 8
x = 1