Supplementary Air System or AIS add air into the exhaust to clean up unburnt fuel by igniting it in the exhaust. this is the popping you hear when you close the throttle.

This annoys some people and with the ECU Hack (Link) it will cause the exhaust to flame. Fun a few times but after a while it is a bit of a liability.

The disconnect is easy.

Cut pipe and seal where it comes out of the airbox. remove pipe from around front of engine. Remove AIS module and tape up the electrical connector.

Now you may find that the allen bolts holding the metal pipe leading to cylinder head are not moving. you will need to significantly douse it in penetrating fluid. Once off you need to install a blanking plate.

You can either make one or get one here https://www.off-the-road.de/en/XT-660R-X-otr/Engine-Tuning/AGR-blanket-kit-Yamaha-XT-660.html

If you can't get it off all is not lost. leave the silver pipe reaching out from the cylinder head on and saw it off at a reasonable distance from the exhaust so it doesn't get too hot. the pipe is 15mm in diameter so get a central heating 15mm copper end cap, saw down one side so it can be clamped put a bit of exhaust jointing compound on the cap and then use a good quality worm screw clamp to hold it on.

Mine lasted for 3 years without problem and is, I am sure still going strong.