If you have it plugged into a wall outlet rather than the TV's USB power port, and you have tried different locations and it continues to overheat, then you can reasonably conclude an internal device issue that needs replacement. If less than a year old, then should qualify for free replacement.
https://support.roku.com/article/208757058
If your device is a Streaming Stick, Roku does offer a free HDMI extender that may help to put some distance between the TV and the Stick. https://my.roku.com/hdmi and https://support.roku.com/article/115008193567
Roku's info regarding overheating...pretty basic. https://support.roku.com/article/226794787
Roku Community Streaming Expert
Just another Roku user... I am not a Roku employee.
Insignia RokuTV, Ultra 4660x, Premiere+ 3921, Express 4k+ 3941