Methocarbamol. Muscle relaxants are used to treat musculoskeletal conditions, spasticity, and anxiety. They work by relaxing muscles and blocking pain signals to reduce pain and stiffness and by slowing down brain activity.