Everyone one of us has these thoughts and feelings at some point in their life. It may be to do with age, a bereavement, being in a job that is unfulfilling, not having a job, a relationship or just life in general. What I,m getting at is that it's completely normal to feel the way you are feeling every now and again. The problems come when you start to let these thoughts and doubts take over your life and crawl into a shell . You've recognised that you're starting to slip again and come on here, which is a big step in the right direction to getting help if you need it.
Have a look at this site run by the NHS - THE MENTAL HEALTH forum. I always recommend it when I come on here. It's an online community of sufferers of every type of mental health problem you can think of.. I can 100 % say that there will be someone on there who is feeling exactly the same as you are and you'll find bags of support and advice on this site.
You say that you don't think that you're life is going anywhere ?. How many people do you know live a completely fulfilled life that's constantly moving upwards ?. Probably no one. The only person I know who is genuinely one hundred per cent happy is an old mate who found religion years ago as result of some serious problems in her life. She's only happy as her faith has removed all her problems, which is great for her, but I wouldn't want it for myself.
Like others have said, go to your GP and be honest. If you have one mate who you think will support you tell them too, tell your family if you can. You,ll be surprised how supportive people can be if you give them a chance. Good luck mate, keep posting.