Optifine is a useful performance mod for Forge that allows you to optimize your video settings and churn out a bit extra FPS. If quality is more your style, Optifine also allows you to install Shaderpacks alongside it to make your game that much prettier!
⚠️WARNING: Optifine is a CLIENT-SIDE ONLY mod. This means you only have to install it on your local installation of minecraft in order for it to work. Attempting to add this mod to a server WILL CAUSE IT TO CRASH!
Downloading Optifine
Downloading Optifine is easy. You can find their list of downloads from this link.
From there, choose whichever version you wish to download. In this case, I'm going to install OptiFine HD U J3 for 1.21.4
You'll be taken to a new page. Wait a few seconds, then press the skip button in the top right to get to the download page for the version you've selected. Be sure your Forge version matches the version you're downloading as well. In our case, it will be for Forge 54.0.34.
Installing Optifine
Now that we've gotten the file we need, we'll need to find our mods folder. In this case, I'll use CurseForge to get to my mods, but if you're not using that, you can find it in %AppData%/.minecraft/mods (assuming you already have forge installed).
For CurseForge, find your modded profile and right-click it, then press Open Folder
Then you can drop your downloaded Optifine version into the mods folder. It may not look exactly like mine, but it should be close enough.
Once you have the mod in there, launch the profile, and you should notice more options and the Optifine version in the bottom left of the Video Settings tab: