Author Stephen King announced Thursday that he is leaving the social media platform X because of its “toxic” environment.