In general, muscles work when calcium ions are released, which triggers muscle cells to contract. The contracting muscles pull on tendons, which in turn pull on the bones to which they are attached.
Proteins called "actin" and "myosin" form filaments, which form crossbridges during contraction. The actin and myosin filaments pull past each other when a flood of calcium ions signals contraction, and this causes the muscle sheath to become shorter. This leads all the sheaths (called "sarcomeres") to shorten, and the contraction is synchronized across the entire muscle. All muscle contractions are triggered by electrical impulses which travel from your brain to the nerve endings in contact with the actin and myosin filaments.