Download the correct OptiFine version for your Minecraft version
Install Java if it is required on your system
Open the OptiFine `.jar` file
Click `Install`
Open the Minecraft Launcher
Select the OptiFine profile
Click `Play`
Open `Options`
Open `Video Settings`
Adjust graphics, performance, and quality settings as needed
Use `Shaders` if you have installed shader packs
Place shader packs in the `shaderpacks` folder
Place resource packs in the `resourcepacks` folder
Restart Minecraft after changing OptiFine files or settings if needed
