If you were banned for 'Inappropriate Name', that means your in-game name can be disturbing to some other players. Don't worry though. Just change your name and wait the remaining 2 hours for the ban to expire
HOW TO CHANGE YOUR IN-GAME NAME
1. First, go to https://mojang.com/ and click Account in the top-right corner
2. Now, click login, also in the top-right corner.
3. Sign in with your Minecraft email and password you chose upon creating your account.
4. Under My Games, you will see Minecraft: Java Edition. Then look to the right more and you will see your in-game name and next to it, you can click change.
5. Now enter your new Minecraft in-game name you want, then enter your password.
Done!
Please note that you can only change your Minecraft in-game name every 30 days, so choose wisely!