I understand myself and what causes my suicidal ideation very well, but it took about a decade for me to get this point. For some it is easier than others; YMMV.
People have taken their lives for any number of reasons so it's hard to say what might be causing it without more information. If I had to throw some possibilities out there for an underlying cause, it seems these days that loneliness, financial strain, and the unstable/hostile sociopolitical climate have been leading causes of despair and suicide. Also seen lots of burnout and mental fatigue from overworking. I have no stats to back that up, it's based on anecdotal experience and personal observations.
I think it takes a whole lot of introspection and sometimes outside perspectives to verify the reasons yourself. It can be very helpful talking to people you trust about these things. It doesn't necessarily have to be a therapist. Unfortunately not everyone is going to be effective at helping you in this way (including professionals) so you might have to shop around for the right people.
There are many things that could be blocking your awareness of the true underlying problem. For a long time I struggled to understand my own feelings because of internalized shame. It was too painful to think about and I couldn't admit my own problems to myself. When I forgave myself for the way I feel and accepted that my problems were valid, the shame eased up, and the fog cleared.