Xbox controller does not connect to pc?

Hiiii… Im Johnson

My controller is not connecting to my pc, it is connected Bluetooth to the controller and then disconnected automatically that’s why I having problem playing games how can I fix it

Update controller firmware from Windows or use xpadneo. You’ll find more here:
https://wiki.archlinux.org/title/Gamepad#Connect_Xbox_Wireless_Controller_with_Bluetooth

Thanks I will check

Thanks, Tomek.
I updated my controller framework then it worked properly but after updating the framework in controllers some buttons were not working correctly So my friend told me this website https://gamepadtester.net to see if the controller is working and to see if it is working properly. Thanks for suggesting to me both the websites have helped me a lot to repair it