I changed my username on Minecraft, and I tried logging out and back in but it won't work. I tried multiple times but I still can't go on any servers.
I'm pretty sure that they now prefer you to use the email address for your account and not the username.
This article details which to use: Do I log in with my email or username?
You log in with your email address if you purchased Minecraft after November 2012, or migrated your username to a Mojang account.
You log in with your username if you have an older Minecraft account, and have not yet migrated to the new account format. You can migrate to a Mojang account from the Mojang accounts page.