I have a Roku a few years old now. I need to get a longer cable to plug into the wall. I only have the short cable that plugs from HDMI connection to a USB and is only 6 inches long in total. I would like to buy the right product. But not sure what this is. Please help.
You appear to be confusing HDMI and USB. That short 6" cable is probably the HDMI extension cable and has nothing to do with the low power issue. The power comes from the USB cable and depending on the model of your stick (I'm assuming you have a stick) it may have the Wi-Fi receiver in it as well (although I don't think any of those are a few years old). You can always just use an AC extension cord like we've all been using for decades for lamps, Christmas lights, and whatnot and plug the power adapter into it. Otherwise, you need something like this:
https://www.roku.com/products/accessories/roku-power-adaptor-with-extender-cable
It would help to know the model number of your Roku device displayed under Settings->System->About.