According to the MM skeletons are animated by dark magic. They heed the summons of spellcasters who call them from their tombs. The magical energy motivates a skeleton to move and think in a rudimentary fashion. I assume that a similar effect animates and controls all undead. So if I cast dispel magic on a skeleton or any other undead do they cease to be animated and can't move or act?
No. Dispel Magic has a single purpose... to end spell effects.
They can only be used to end existing spell effects of greater than instantaneous duration, and ignores other magical effects such as Arcane Ward and Wild Shape or a Vampire's Gaze.
Jeremy Crawford starts every answer to how dispel magic works the same way...
"Dispel magic does one thing: end spells on its target. It does nothing to other magical effects."
The Sage Advice Compendium also says the same thing. See the answer to the question:
Can you use dispel magic on the creations of a spell like animate dead or affect those creations with antimagic field?
It will affect undead and constructs the same as other beings; for instance, if they have a magic spell on them like Protection from Good and Evil, it will end that. Specific spell descriptions can override this such as Wall of Force.
Please also see my other answer for things not directly addressed to this question. There are a lot of duplicates or slight variations of this question floating about so arguments don't always get repeated.
No. Slagmoth's answer adequately addresses the fact that Dispel Magic explicitly only ends spells on a target.
However, if you want such an effect, the (significantly higher-level) spell Antimagic Field will disrupt the magic that animates golems (but not undead). The relevant part of the description states:
Creatures and Objects. A creature or object summoned or created by magic temporarily winks out of existence in the sphere. Such a creature instantly reappears once the space the creature occupied is no longer within the sphere.
Golems are created by magic, and thus they would wink out of existence in an antimagic field. As a DM, I would rule that their mundane parts would remain, inanimate, inside the field.
Because golems are a point of contention, I will point out that the Monster Manual states:
After constructing the body from clay, flesh, iron, or stone, the golem's creator infuses it with a spirit from the Elemental Plane of Earth. [...] This process binds the spirit to the artificial body and subjects it to the will of the golem's creator.
I would argue that this means that the animating force in a golem is technically a spirit summoned from another plane, and would thus be banished by the Antimagic Field. It's not obvious that this applies to all constructs, but I'd argue that most constructs would fall under "creature created by magic" and thus be affected by the spell. Otherwise, why include the "created" term at all?
Possible exceptions to this would be the denizens of Mechanus, who are more like living manifestations of law rather than a wizard's creation.