Note: During a reset, it is recommended to use the original USB cable supplied with the console. However, you can use another, like me for example with a USB-C cable on both sides to free up the front USB port of the console. However, even if a majority of USB Type-C cables do data + charging, check this point before using/buying another.
To begin, turn off your PS5 then unplug your controller if it is currently connected with the USB cable. Then turn the controller over, below you should see a small hole on the right side of the controller next to the Sony inscription.
Then take a fairly thin tool / object such as a paperclip or toothpick and put it in the hole. At the bottom, you should feel a button and so the idea is to press this button for 5-6 seconds maximum.
Once the reset is done, connect the controller to your USB cable and then to the console. Then press the PS button. This will pair your controller to the console using the USB cable.
Your controller has been reset and can now be used, there you go, now these will wok like charm.
If after the reset the console does not turn on when pressing the PS button, make sure you are using a good cable if it is not the original one. In which case you can also try to connect your controller to a PC with the USB cable to see if it is recognized and functional.