A guide by ablazingeboy
NOTE: This guide is written for 1.16.5, as many mods aren't available for 1.17 yet. Once all the prerequisite mods are available for 1.17, this guide should work for that version as well.
Before we even consider optimizing Minecraft, make sure your actual PC is performing at it's best. If you're running Windows, run a malware scan using something like Malwarebytes and make sure everything is hunky-dory. If you're running any OS, and you've been running the same install for years, consider backing up your data, wiping, and starting fresh. Viruses, or computer "cruft" accumulated over the years can really shoot your performance in the foot. If you're on a particularly old/low-spec machine, consider possibly switching to Linux.