I originally purchased an SNES controller manufactured by 8BitDo: https://www.amazon.com/gp/product/B00Y0LUQFE
Unfortunately, the bluetooth function was not reliable and kept kicking out after 20-30 seconds.
As a result of this failure, I tried out a PS3 bluetooth controller. Followed along with this tutorial:
https://github.com/retropie/retropie-setup/wiki/Setting-up-a-PS3-controller
It mostly worked. Whatever you do, do not follow along with this tutorial for the PS3 controllers since it is more intended for controllers like those from 8BitDo:
https://github.com/retropie/retropie-setup/wiki/setting-up-a-bluetooth-controller
When booting up RetroPie, it would tell me that it detected a gamepad even though the PS3 controller was off and nothing else was plugged into the Pi. Turns out that there were other gamepad drivers installed, which tricks EmulationStation on the number of gamepads connected. To fix this, I uninstalled all non-PS3 device drivers per this article:
Finally, the #1 light lit up on the PS3 controller. Rebooting turns off the controller, as it should. And holding down the PS button reconnects the Bluetooth successfully.