I can't fall asleep

I've been trying to fall asleep since 10pm and it's almost 3 right now. My mind keeps racing and I can't get to quiet it down. I've been turning and fidgeting for the last 4 hours. I have meds that can help me quiet my mind but I can't go past the prescribed dose.

I have antidepressants that I'm only supposed to take when I'm experiencing a lot of anxiety but I'm thinking of taking a pill to help me sleep. Is this safe?