You’re more likely to have sleep problems if you have untreated mental health issues. It might be a condition like anxiety, depression, or bipolar disorder. Or it could be a difficult period in your life, like losing your job or partner. Whatever the cause, talk therapy, medication, or both might help. Ask your doctor what’s best for you.