If the device is overheating, then that could cause any number of different issues.
No guarantee that getting the device back to normal operating temps will help with WiFi speed, but even if WiFi speeds were normal, you would want to try to fix the overheating issue since it will cause more problems sooner rather than later.
Overheating is almost always caused by an internal fan that has become clogged with dust. This usually happens with units that are 18-24 months old, but it can occur earlier or later as well.
If the Time Capsule is less than a year old, Apple will replace the device for you. Or, if you have AppleCare in effect on one of your Macs.....and....the Time Capsule is less than 3 years old, Apple will usually replace the device in that situation.
If the Time Capsule is not covered, and you want to keep the product, then the next option would be to open up the Time Capsule and replace the fan. Unfortunately, this is not an easy task for most users, so only the good do it yourself types should attempt this.
A shop could probably do this for you as well, but the cost of labor would likely be far more than the value of the product.
The following article will provide some tips on opening up the Time Capsule........AirPort Time Capsule A1470 (Mini!) Teardown - iFixithttps://www.ifixit.com/Teardown/AirPort+Time+Capsule+A1470...Teardown/15067
Replacement fans are available from a number of sources. Google for "AirPort Extreme fan" or "AirPort Time Capsule fan". It's the same part for both products.
AirPort Extreme A1521 Fan Replacement - iFixit Repair Guidehttps://www.ifixit.com/Guide/AirPort+Extreme+A1521+Fan+Replacement/19553 might help as well, but there is no hard drive inside the AirPort Extreme.
If you decide to try repairs, be extremely careful as it is very easy to break a connector or cable in the process. The product was not really designed for easy disassembly.