This seems to be a problem with Optifine. Remove Optifine and see if it works.

I found this thread: https://discuss.aristois.net/topic/13/how-to-uninstall-optifine-optifine-error-on-startup
It shows you how to uninstall Optifine.

Exactly this