If Just Enough Items (JEI) isn't working or the game crashes, try these fixes in order.
Fixes
JEI not showing: check it's the correct version for your Minecraft
Recipes missing for a mod: install that mod's JEI addon
Search not working: restart the game after installing
Overlapping with OptiFine: there's no conflict, they coexist fine
Still broken?
Make sure you downloaded the correct version for your Minecraft version and mod loader, and that Java is up to date. A common cause is mixing Fabric and Forge builds - use the right one for your setup.