It’s a common issue with Xbox wired controller. In my case it was a damaged little part of the wire that was causing the random disconnect. Below are the steps to fix it.
- Find the damaged part of the wire and cut that part with scissors.
- Remove the outer rubber sheathing and underneath you’ll find foil and a silver wire mesh, remove it too.
- Now you can see 4 different coloured thin wires (Black,Red,Green,White), remove some part of their outer rubber covering.
- Now twist the same colour wire from one end to the other end.
- Tape the four wires differently so that their inner covering doesn’t touch each other.
- Now tape the whole part tightly and get back to gaming.
If you can’t find the damaged part then you can follow this tutorial to solder a new cable to your Xbox controller circuit board.