text: Both depression and anxiety can contribute to insomnia, which could include difficulty falling and staying asleep. Making changes in your routine may help with getting a more restful sleep throughout the night.