I need help while I'm playing Minecraft I go to realms and it says invalid session restart your game so I do but this bug continues Please

I need help while I'm playing Minecraft I go to realms and it says invalid session restart your game so I do but this bug continues Please

Try reinstalling the game. Its a long-winded method, but will usually repair the corrupt file