If your device isn't behaving normally, it may just need to be reset back to factory settings to get everything working again. Before attempting to wipe your device, make sure that you have backed up all of your files as everything on your drive will be erased! You will also need to reinstall any programs that you use.
Reset your Chromebook to factory settings.
Reinstall MacOS.
Reinstalling Windows differs quite a bit depending on your computer manufacturer and Windows version. Please be sure to look up the proper procedures for your specific model on the manufacturer's support site.