To enable Minecraft multiplayer on that Microsoft account, you’ll need to update the Xbox privacy/online safety permission for the profile. The official steps are outlined here:
https://help.minecraft.net/hc/en-us/articles/24302916594701
If you’re being prompted to do this, it means the account is still classified as a child/teen account (this is determined by the date of birth on the Microsoft account), and those settings can only be changed by an adult Family Organizer.
An adult Microsoft account needs to create a Microsoft family group, then invite your account as a “family member” (child/teen), the adult account must remain the Organizer. Once you’re in the family group, the organizer can sign in with their adult account and allow the relevant permissions.