“God hates divorce” is one way Mal 2:16 have been translated, and these words does not appear elsewhere in scripture. The more literal translation is “God hates putting away”:
Therefore take heed to your spirit, and let none deal treacherously against the wife of his youth. For the LORD, the God of Israel, saith that he hateth putting away (Malachi 2:15-16, KJV)
But scholars tell us that “putting away” is, in the Bible, not synonymous with divorce. It means to abandon without divorcing. That was worse than divorce, because the divorced could remarry and the abandoned married woman cannot. This passage tells men to be kind to their wives and not to leave them destitute. God cares about female welfare here, He is not commanding her to stay in an abusive marriage.