Any test that you receive, Allah knows that you can handle it.
Honestly, I've thought about this a lot. I give thanks to Allah for Him taking out me from the slumps of depression couple of years back.
Generally, its forbidden.
Maksudnya: “Sesiapa yang membunuh diri dengan besi, maka di neraka jahanam nanti besi itu selalu di tangannya, ia menusuk-nusukkannya ke perutnya selama-lamanya. Dan barangsiapa bunuh diri dengan meminum racun, maka di neraka jahanam nanti ia akan terus meminumnya selama-lamanya. Dan barangsiapa bunuh diri dengan menjatuhkan diri dari gunung, maka di neraka jahanam nanti, ia akan menjatuhkan (dirinya) selama-lamanya.”
(Sahih Muslim no. 109)
For your own, please keep yourself away from it.
Hadith Qudsi 28:
On the authority of Jundub ibn Abdullah (may Allah be pleased with him), who said that the Messenger of Allah (peace be upon him) said:
There was amongst those before you a man who had a wound. He was in [such] anguish that he took a knife and made with it a cut in his hand, and the blood did not cease to flow till he died. Allah the Almighty said: My servant has himself forestalled Me; I have forbidden him Paradise.
However, if you see other people suicide, then please don't judge him / her and say he will go to hell, etc. Only Allah can judge him. His mercy is more than His wrath.
Say, ˹O Prophet, that Allah says,˺ “O My servants who have exceeded the limits against their souls! Do not lose hope in Allah’s mercy, for Allah certainly forgives all sins.1 He is indeed the All-Forgiving, Most Merciful. (39:53)
Jundab reported: The Messenger of Allah, peace and blessings be upon him, said, “A man said: By Allah, Allah will not forgive this person! Allah Almighty said: Who is he who swore by me that I will not forgive someone? I have forgiven him and nullified your good deeds.”
Source: Ṣaḥīḥ Muslim 2621
if Allah knows he can handle it, meaning he will pass the test and suicide will not take place.
unless, refer to your phrase about 'we cannot judge people on whatever they do', which i bilip including suicide, suicide is in the same scope as 'you can handle it/ the way u handle it', and Allah is ok with it.