You can divorce your spouse in Islam as a last resort. You can pronounce Talaq twice but the third time you must let the woman go.
Before Islam, men divorced their wives and they also had a waiting period. However, right before that ended, they would take their wife back. They would keep doing this and it is not right. Your wife is not a toy.
Allah put a stop to this and said you can pronounce Talaq twice and take back your wife, however, on the third time you must let her go. You should not harm your spouse in anyway during divorce.