Hey there kittiebo,
Thanks for reaching out to Apple Support Communities. We understand your iPhone becomes unresponsive when joining a Wi-Fi network. It should connect without any issue and we’ll be happy to help with this.
Since the issue returns after restarting, the next step would be to ensure your iPhone is up to date:
Update your iPhone, iPad, or iPod touch
If that has no impact on this, reset your Network Settings. Tap Settings > General > Reset > Reset Network Settings. This also resets Wi-Fi networks and passwords, cellular settings, and VPN and APN settings that you’ve used before. You can read more about this here:
If your iPhone, iPad, or iPod touch won’t connect to a Wi-Fi network
We hope this helps.
Take care.