Hi,
I'm not speaking from a place of "being clean" for a significant amount of time or so, just want to share what I noticed does help, and what, in my own experience tends to bring me down...
1. what helps is being out there, in real life, talking to people, and in general being active, doing things.
2. very important to go to shul every day, even, and especially, after a yeridah.
3. make sure to learn torah, and especially chassidus every day.
what generally brings me down is,
1. Loneliness at home, when wife and family are sleeping and Im not tired...
go on computer, and after a while... you know..
for me, it's sometimes better to be in shul late then come home and potentially waste my time and get to these things chas vshalom
2. when I'm really excited, and on a high, for good reasons, but don't know how or where to channel that energy... unfortunately it many times brings to this.... oh well.
3. emptyness. if I haven't studied Torah that day at all, or not davened maariv yet....
also helps to have an active day by day and in general to be productive and "giving", i.e. not just reading or keeping to yourself but talking with people, and accomplishing things.
and ALWAYS ALWAYS get right back on track, keep davening, learning, aderabe, that is what helps you get back on track.
i wish I had advice on how to stay clean long term, but sadly can't say that yet...
but there is always hope, and as hard as it is, the fact that were still alive means H' is giving us another chance, and is waiting for us.