Using /link in-game shows
You have to get a code by typing !link in the
#link-minecraft-account-here discord channel.
You will get a DM with a code on discord. Then type
/sync Discord <CODE> on the Minecraft server.
Note that I have linked my account to Discord and my account is on Bedrock.