I think my headphone or phone jack broke, and if I move the jack a bit, somehow the headphones activate the google assistant or pause the music, so this is from the button.
Can I deactivate it on a non rooted Huawei P8Lite (Android 6.0)
Software wise: HeadsetBlocker & Wizdroid both attempt to block headphone buttons. However both are very outdated. Can install and try.
Hardware wise: You can try a 4 pole to 3 pole adapter to remove the microphone (I am not positive this will work)
This solution certainly won't work for everyone, but if your headphones happen to have a removable cable: trying turning it upside down (plugging the phone end into the headphones and vice versa). With my particular cable this disables the controls.