On Android User A taps on the wifi they are connected to and gets a QR code, and User B taps on the icon for scanning wifi QR codes, so one tap each once you are in your wifi settings.
On iOS, the guest attempts to connect and anyone with them in their contacts list is prompted to share. The common use case of a friend visiting is very simple. If you want to share a different network, there's a similar flow to the Android one: