What happens in general varies a lot based on the relative timing of the two effects, the specific effects involved, and the nature of their sources' descriptions. The general answer is that either one of the effects happens, or the other effect happens, or some third thing happens which is neither the first effect nor the second, but in no case should a logically contradictory state result.
In your explanation both of the example effects have the two damage sources occurring simultaneously and the effects are not so much contradictory as conflicting, so we will from here on deal exclusively with this case.
The exact nature of attack resolution has been a subject of some debate for some time (see this pathfinder question which links to this 3.5 question), and this question to some extent hinges on how atomic the attack action is. While some groups declare that the source of a simultaneous group of effects chooses in what order the effects are resolved, most groups, my own included, declare that all effects in a simultaneous group should be resolved simultaneously. It should be noted that this is a different question, as many groups that play with non-atomic attack actions hold that the dealing of damage is a single atomic step in an attack.
The minority opinion is, in this case, much simpler to adjudicate: The warrior swinging the sword or the mage casting the spell is asked whether he wants the fire or electricity damage to be dealt first (or the Gm just has him declare what the damage dice are from as he rolls if the GM wants to be sneaky, using the order of declaration as the order of resolution). If the electricity damage happens first, the golem is healed and slowed. If the fire damage happens first, the golem is just healed.
The majority opinion is somewhat more complicated since the electricity and fire damage happen at the same time. I personally use the Waving Hands resolution system for simultaneous effects, because I think it makes the most sense and does a good job of being internally consistent. In this case, the electricity effect triggers at the same time as the fire damage is causing the creature to have just begun being slow, so the electricity effect counters the fire one and the creature is just healed by the electricity effect.