You've already gotten the formal and, thus, best answer.
However, formal writing isn't the only writing the same way formal speaking isn't the only speaking.
A semicolon can serve to break up sentences into segments when it's really long and contains commas out the wazoo already. It makes such things more readable.
I've also seen them used informally to indicate a longer pause in speech than a comma, but not as long as that indicated by a period.
Think of a period as when someone would pause, take a breath, then start again. A comma is just the pause; a semicolon would be the kind of quick breath you use when commanding, singing, or otherwise using your voice for an extended span where stopping for a full breath isn't desired.
Again those are informal uses, but they do exist and can become a formal use given enough time and adoption. The problem is that until that happens, it's confusing for anyone that reads them that is more familiar with formal writing. So, as a communication tool, using them informally can be ineffective. Kind of a tossup tbh.