Although there is a slim possibility, you'll undoubtedly run into Kodi unable to connect issue when the internet connection is not working properly. So first of all, you should check your network connection on your device.
Solution: Since Kodi shares the same network connection with computer or other devices in the same Wi-Fi environment, check if the internet access works properly outside Kodi. If not, troubleshoot the issue using Network Diagnostics or something like that on your device. Also, reboot Kodi, your modem, rooter and even the device to make a further troubleshooting. Generally, it will somehow settle this case.