The sign is just convention and not everyone agrees with what the best convention is. You can't really have a "negative" energy. In some texts you'll the see internal energy, U, written as q + w and sometimes as q - w. In the end it's the same - in the former case you add a negative number. In the latter you subtract a positive number. I can't remember what IUPAC recommends.
The important point is this: if the system is going from a low potential energy to a high potential energy state, then work has to have been done by something else on the system to bring it to that state. However work can even be done when the system is going from a high potential state to a low potential state, IF there is a force that resists this conversion of potential energy to kinetic energy.
The simplest example of all this is gravity: when we lift a box, we bring it from a low potential state to a high potential state and work AGAINST gravity. The lifter is the "surroundings" and the box is the "system". The surroundings (the lifter) does work on the system (the box) and the force he is working AGAINST is gravity. If he lets go of the box, it will fall spontaneously, converting the potential energy as kinetic energy. When it falls, the box does no work on the surroundings because the surroundings are not applying a force to resist this process. The change in the internal energy of the system changes when I lift the box, but not when it falls. (We're going to come back to this in a second, so before you protest against the obvious problem with this statement, hang on!)
Now let's take a more relevant example: when we compress a(n ideal) gas, the system goes from a low potential energy state to a high potential energy state. For an ideal gas, the only "resistant" force is entropy, but it nevertheless takes work to compress the gas. In an ideal gas, there are intermolecular forces that attenuate the amount of work required, but the concept is the same. The surroundings (whatever is doing the compressing) does work on the system (the gas) and therefore the internal energy goes UP.
Pretend now that we compress the gas into a cylinder, expending energy/work to do so. We place the cylinder in a vacuum chamber and open the valve. What happens? The gas expands, of course, but since it is expanding into a vacuum, no work is done by the gas. There is no force resisting expansion. While some energy may be converted (particularly in a real gas) to other forms, there is no net loss of energy in the system, so the change in internal energy is zero. We call this a free expansion, and the temperature for this process (in an ideal gas) does not change. This is identical to the fall of a box described earlier.
Ok, you might say, well the falling box DOES eventually hit the ground, so the system DOES lose energy. Right? Indeed. When the falling box hits the ground, the ground exerts a force on the box to cause it (the box) to stop. The box loses kinetic energy (transferring it to the ground) and it has also lost potential energy by loss of altitude. Clearly the internal energy of the system (the box) has been decreased. Yes! Here the system (the box) has done work on/against the surroundings (the ground). It might be hard to see why, but when the box decelerates by hitting the ground, it is pushing against the ground, and particularly against the force holding the ground together as a solid, and compressing the ground ever so slightly. It takes work to do this, and it is work done by the system. So the system has done work on (against! I like against better) the system. Since the system does work, it has to use energy, so it has to lose energy. And by the way, hitting the ground isn't the only place where the system (the box) does work: it also works against air as it falls. Air resists motion in the form of a frictional force. So as the box is falling, it is working against this fricational force, and some of its kinetic energy is lost to the surroundings (the air). Here again the system does work, therefore it loses energy to the surroundings.
Back to the gas cylinder with this analogy in mind: instead of putting the cylinder into a vacuum, what happens when we just open it in the atmosphere? True the system is in a state of high potential energy and will spontaneously expand, but now it's expanding against a resisting force: the atmospheric pressure. In essence, the expanding gas has to push against the gas molecules that are already there, and in the course of this there will be collisions, and therefore the system (the expanding gas) will transfer some of its kinetic energy to the surroundings (the gas already there), resulting in a loss of energy. This is work. It is also why an expanding gas cools when the expansion isn't "free", even for an ideal gas. As such, the system does work on (against!) the surroundings, and thus loses internal energy.
I know sometimes it's odd to think of work being done in a seemingly downhill process. It's easy to see how work is done when you lift a box. Less easy to see is how work is also done when the box falls. It's just the nature (and quantity) of work being done. It takes a lot of work to lift a box. Comparatively smaller amount if the box is falling, because the resisting force is less... until the box hits the ground. Same with an expanding and compressing gas. It's easy to see how it takes lot of work/energy to compress a gas. But the gas does work when it expands, as well, because there's a force resisting this expansion... even though that resisting force is considerably smaller than the force promoting the expansion!
So. Concepts out of the way - let's look at the equations.
If the gas expands, it does work because it loses energy. If we frame the work done as being positive when the work is done BY the system ON/AGAINST the surroundings, we use this equation:
ΔU = q - w
The system did work, so the work done by the system is positive, therefore the change in U is negative (no heat transfer, ΔH = 0). As we expect.
On the other hand, if we define the work done as being negative when the work is done BY the system ON/AGAINST the surroundings we use the equation:
ΔU = q + w
To me the former one makes a little more sense because it's more system-centric, but some prefer the latter because the work is AGAINST the force imposed by the surroundings.
Whatever, doesn't matter. Just another annoying source of confusion for thermodynamics. Whatever convention you use, if you keep in mind the concept, you won't get the answer wrong. Although I recommend you stick to the convention used by your professor or teacher, since they'll probably grade you accordingly.
Just remember: work done by the system AGAINST the surroundings, the system's total energy reserve decreases because some energy has to be used to do that work.