In most cases, this is a sign that the cable has become damaged and is unable to connect to your audio device. Over time, repeated bending and twisting can damage the wires inside of the headphone cord. This can cause internal frayed wires or exposed copper connections that may lead to audio stuttering and random disconnections. If this is the case, it is best to replace the headphones since repairing them would require specialized tools and knowledge.
Another possible reason your wired earbuds keep cutting out is that the audio port on your device or the jack itself has become dirty. This can happen over time if you do not regularly clean your headphones and devices. Over time, the earbuds can accumulate dust, flufff, and lint inside the jack or audio port.
If you have tried to clean the jack and it still does not resolve your issue, the earbuds may need to be replaced. This is also a good time to consider upgrading to wireless headphones.
In order to fix the faulty cable, you should carefully bend and twist the headphones to find a position where they are still working correctly. Once you have found this position, you can use electrical tape to repair the cord. This is a temporary solution, but it can work well until you are able to replace your headphones. To prevent this issue in the future, it is a good idea to only use your headphones for listening to music or podcasts and to always handle them with care.