You can test internet speed within Kodi, by installing tvaddons' Indigo add-on. It has many other handy utilities.
If that is the problem, you can try testing your internet/router service using another device (e.g. smartphone), rebooting the router, connecting a cable rather than wifi, etc.