The basic requisite for comfort/peace is love. If you didn't get that in childhood, you will f**k yourself in multiple painful ways in an attempt to understand what went wrong. One of those painful self-f**kings is religion, but there's heaps of ways.
The solution is to convince the subconscious you are loved. You have to trick your own brain, and it will resist your trickery. There are ways though.