If you are looking to share an Xbox Series X/S with someone and need to set up another account, there is one main way to do so. This will likely be most common for a family group sharing the same ...
If a friend has a digital game on Xbox you want to play, you don't need to buy an extra copy. You can play theirs on your console with gameshare.
You can link your Epic Games account to an Xbox Live account so that the two gaming accounts are associated with each other.