Marriage is the solution for many things, but it is not the solution to psychological problems. If you come to a relationship with psychological problems, there is a significant probability that they will only get worse.
If you are suffering from depression, acute anxiety, an addiction, or the like, give your full attention to addressing that issue before you further complicate your life by trying to form a relationship.
Once you have gotten on top of your issue, you will be in a much better position to hold it all together during dating and marriage. If you are not in the right state of mind to date, no amount of covering it up is going to work.