Firstly, make sure the controller’s logo button’s indicator light is always on, green for xinput mode and red for switch mode.
If it does not light up, it means that the controller is not successfully connected, check whether the controller is firmly plugged into the interface with the data cable.