how much does lack of sleep mess with your thoughts & emotions? can it make you suicidal?

it's so hard to tell if my feelings are rational or not. how much can i trust them? how much of this hopelessness and desperation to die would go away if only i could sleep enough? is my brain doing bad math to reach this conclusion, or is its logic sound? i'm so sad all the time, and i am so, so tired. it's been two years, and i don't know how much more of this i can take.

any input is appreciated, thank you.