A rocket moving at 2000 m/s with a mass of 2000 kg releases gas at 500 m/s perpendicular to the direction of the rocket. The rocket moves at 18 degrees opposite of the direction that the gas was released. What is the mass of the gas released?

There is no change of momentum of anything in the original, call it x, direction. Both the rocket and the expelled gas will continue to move at 2000 m/s

In the y direction. the gas moves in the + y direction and the rocket moves in the - y direction. However the total y momentum of the system remains zero since there was no net force on the system.
If the mass of gas is m, the remaining mass of the rocket is (2000-m)
the y direction speed of the remaining rocket is -2000 tan (18) = -650 m/s
The y momentum of the gas is m (+500)
The y momentum of the remaining rocket is (2000-m)(-650)
so
500 m -650(2000-m) = 0