It is a sin to kill yourself. Whether you put a gun to your head, or take pills, or crash your car makes no difference.
Thinking "I hope I die" is not quite the same thing as thinking "I'm going to kill myself." It is still very likely a sin, because it probably involves things like despair and...