I will switch from console to PC in the future and am afraid that I will have to buy a new Minecraft Bedrock edition.
Yes, with a new platform you have to buy the license again.
With Xbox actually not like it is with Playstation I don't know
In the past you could get Minecraft from your XBox on your PC.
But I don't know whether that is still possible. But I would generally advise you to buy the Java version, because it offers more options.
I don't know, definitely on PS4. But the Java Edition is better anyway, if so I would recommend it to you.
You can see that on the Xbox Play Anywhere https://www.xbox.com/...y-anywhere. These are games that you can play on the console and PC without having to buy them again. Unfortunately, Minecraft is not one of them. Minecraft unfortunately has to be bought new.