Hello lubomir262,
Some steps that may be able to resolve issues with joining a Wi-Fi network can include the following:
•Try toggling Wi-Fi off fully from Settings > Wi-Fi (not Control Center).
•Ensure the iPhone is using the latest iOS version (Settings > General > Software Update)
•Double-check that the date, time and region are all accurate in Settings > General > Date & Time.
If possible also try connecting to a different Wi-Fi network to see if others are working fine, or if there may be a broader issue at hand.
Also check for any security software or profiles and VPNs that may be installed. The latter of which will usually be found in Settings > General > VPN & Device Management.
Cheers.