You need to sign in with Microsoft account and launch the game. Then, you have to click on Invite to Game and then select Find Cross-Platform Friends. Now, you can click Add friends and send an invite to them. The players who accept your invitation will become your cross-platform friends on Minecraft.