However, it is important to research hardware/software compatibility (for example, Nvidia graphics cards) before switching operating systems. Linux distributions are generally easier on the computer's resources compared to Windows.
Play Minecraft in windowed mode and make it about half the size of your screen. If the computer is too hot, look into cleaning out dust. This is especially effective for laptops and older desktops.
Either mod can be paired with Starlight and Lithium to speed up lighting updates and general game systems respectively. Note that Sodium only supports Minecraft 1.16+ with Fabric and can't be installed together with OptiFine, but provides significantly higher performance on most PCs.