My counsellor told me this once. hopefully it will be helpful
The human brain is a naturally problem solver. when present with any problem it will instinctively look for a solution. If your problem is big enough, once of the possible solutions your brain will give you is suicide.
However, and this is the key point here, you can choose to ignore it. You ignore the majority of the crap your brain comes up with regularly and you can ignore this too.
hang in there