I've installed Forge 1.12 and Optifine 1.12. When I run Minecraft with Optifine in the mods folder the game crashes. But when I take out Optifine from the mods folder the game just works fine.
Here is the crash log
Is Optifine the only mod that you are using? If so, try installing it by itself - it does not need Forge and is currently incompatible with it; it will also probably run better by itself since Forge adds a lot of overhead:
ETA: An older version of Forge may work, but again, unless you are using Forge for other mods I suggest using Optifine by itself:
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?
Thanks it works well with only Optifine. I was using Forge for Shaders Pack but I learned Optifine does the same thing.