XMPP is a free (as in freedom) instant messaging protocol that has been around since 1999.
Since XMPP is a protocol like IRC or e-mail and is not a centralised service like Discord or Telegram you cannot be shut down and scattered by a central authority such as a group of admins, or some silicon valley company.
It is secure, open and is available through a wide variety of services that do not require personal information. You could even set up your own server.
XMPP features encryption in 1-to-1 conversations, with experimental encryption in multi-user-chats (MUCs), file transfer via HTTP (or external site such as 0x0.st or lainsafe) and audio/visual calls among others. "eXtensible" is the "X" in "XMPP" so it is richly developed and deliberately so. Along with a suitable VOIP substitute it can serve in a full replacement to bad IM services like Discord, WhatsApp, or Telegram.
A friend of mine wrote a couple of great articles about Discord and why you should stop using it here and later here, and the Spyware Watchdog also has an article about it here for those more concerned with technical aspects of privacy.
Reputable services include Hot-Chilli/jabb3r, yaxim, NixNet, and YDFS/yourdata.forsale.
Many clients are available, this being one of the perks of an open standard. If you want one that just werks™ then conversations is a pretty good start, although to get it for free you have to use the F-Droid repo. It has numerous forks, one of which is the blabber.im app, available on F-Droid and the Play Store. It has added features and is generally a nice improvement over conversations.
Note, December 2023: I have fixed some dead links but I do not have the time to go over this section again. It may be outdated since I see the last time I updated this page was in the July of 2021. I still use Psi+ but I hear Dino is fine. Digdeeper has a more recent page on this and I trust him, so go there if you want more detail.
For desktop use, you have a few choices: