THE MOST FAMOUS SUICIDE in the Old Testament is King Saul's. He was doing battle with the Philistines. The Philistines won the day. They killed his three sons, and he himself was wounded by archers. Fearing that he would be captured by the enemy and made a mockery of if he survived, he asked his armor-bearer to put him out of his misery. When the armor-bearer refused, he fell on his own sword (1 Samuel 31:4).
Judas Iscariot's is of course the most famous one in the New Testament. When Jesus was led off to Pilate and condemned to death, Judas took his thirty pieces of silver and tried to return them to the Jewish authorities on the grounds that Jesus was innocent and he had betrayed him. The authorities refused to take them. They said that was his problem, and Judas, throwing the silver to the ground, went off and hanged himself (Matthew 27:3-5).
Taking your own life is not mentioned as a sin in the Bible. There's no suggestion that it was considered either shameful or cowardly. When, as in the case of Saul and Judas, pain, horror, and despair reach a certain point, suicide is perhaps less a voluntary act than a reflex action. If you're being burned alive with a loaded pistol in your hand, it's hard to see how anyone can seriously hold it against you for pulling the trigger.