I've been there many times. I usually find when I feel that I will "do it eventually" I am already in a suicidal state of mind, and am just waiting for the justification (in my mind) to go through with it. I try to keep the option off the table, otherwise it just feeds my problems. If I'm thinking I'm going to kill myself, I'm not going to try much in life. Why train for a marathon if I won't be around to run it? Why take care of myself at all, really.
So what I'm saying is to fight those thoughts, I'll make goals for life, take care of myself, and give myself things to live for. The worse I let the state of my life get, the easier it is for me to convince myself dying would be a good option. By living the life of a me that wouldn't kill himself, I am improving my life while also helping keep that suicidal mentality away.