After trying various remedies with little success, your doctor may prescribe cyclobenzaprine, especially if your sleep problems are a result of muscle tension and stiffness. Known primarily as a muscle relaxant, cyclobenzaprine works by easing the knots and spasms that keep you awake, paving the …