How do you calculate the value for Delta U for a system that loses 50 J of heat and has 150 J of work performed on it by the surrondings? I need to know the formula to use and how to use it. Thank you!

Would it be Delta U = q + w ???

So, -50 +150 = 100 J