muscles work in 'antagonistic muscle pairs'. One muscle of the pair contracts to move the body part, the other muscle in the pair then contracts to return the body part back to the original position.
Muscles are attached to bones by tendons. Muscles contract to move our bones by pulling on them. However, muscles can only pull; they cannot push. This is why they usually work a joint in pairs.