Just as it is forbidden to murder another person, it is forbidden to murder oneself. From a certain perspective, suicide is even more severe, since people who kill themselves also show a lack of gratitude towards God and a lack of belief in divine providence. Moreover, repentance is possible for all other sins, but not for suicide, as the sinner is now dead. The person may imagine suicide will put an end to their suffering, but they ignore the punishment awaiting them in the world of Truth, which will be worse than any suffering in this world.
To condemn the sin and to prevent other people from following in the dead person's footsteps, classic halakha dictates that someone who commits suicide receives only a minimalistic funeral, without a eulogy. They are buried in a separate section of the cemetery, in keeping with the general rule that the wicked should not be buried alongside the righteous. Nevertheless, when a suicide occurs against a background of mental illness (which is true of the vast majority of cases today), the deceased is judged favorably and the suicide is treated as a tragedy rather than a sin. We bury the person and mourn normally, though the funeral is usually kept lowkey.