Hello,
If you are playing together with friends, you must make sure that both you and your friends have added each other on Minecraft and have an active Game Pass/Nintendo Online subscription. Without those, you will not be able to play together.
In addition, if you are trying to play by yourself on two different platforms, that is not possible currently.
What other steps have you tried, and are you getting any specific error messages?
I hope to hear back from you.