direct connect?
Your friend can look up the server address and give you the numbers. To find it with Steam, it’s in View / game servers
I don’t know about Xbox