A preventive measure is to place your phone in Safe Mode. Safe Mode prevents third-party applications from functioning and is useful when troubleshooting issues caused by installed apps or services.
A factory data reset can also resolve some software issues.