Due to the sheer variety of available Shaderpacks it is difficult to determine general system requirements, especially when it comes to graphics cards. Since all Shaderpacks using dynamic shadows require the world to be rendered twice, an at least moderately powerful CPU is recommended. A second gen Ryzen CPU like a 2600X or an older Intel i5 (eg. from the 4000 series) should already provide enough compute power to run Shaderpacks using dynamic shadows at reasonable view distances (eg. 8-12 Chunks). Additionally you should make sure that you have enough system memory installed since Shaderpacks with supported resource packs can use quite a lot of memory. 16GB of RAM are usually a comfortable amount that should allow you to run most if not all Resource- and Shader Pack configurations.
Giving a requirement for a graphics card to be used depends a lot on the used Shaderpacks since there are packs that run fine on integrated graphics while others manage to even make a 2080Ti struggle. Thus no requirement or recommendation is given here, all that generally applies in this regard is that you should make sure to choose a Shaderpacks that your system can deliver the desired performance with.
As for the operating system, Windows and in many cases Gnu/Linux work fine. As for macOS, this is highly dependent on the Shaderpack due to some driver restrictions that are not existing with other operating systems, which is why you should go by the compatibility info given in the Shaderpacks list.
As a final note you should always make sure to use a fairly recent graphics driver version, since older versions may cause issues that are no longer taken into account by Shaderpack developers.
Optifine is the main mod that allows shaders to work. You may have also heard of the Shaders Mod. Don't use this. The shaders mod is massively outdated nowadays and Shaderpack support is included in OptiFine. Starting with OptiFine F2 for Minecraft 1.8.8 the Shaderpack support of OptiFine continuously received new features, which eventually got picked up by Shaderpack developers. This rendered the separate Shaders Mod not only obsolete but also incompatible with modern Shaderpacks relying on these new features.
You can download Optifine here: https://optifine.net/downloads.
You install optifine by executing (double-click) the downloaded java file. This way a new profile will be created inside the minecraft launcher which you then can select by clicking on the game version shown in the bottom left corner.
For a list of available Shaderpacks please check the Shaderpack list.
Once you've downloaded a pack, place the downloaded zip-file in .minecraft/shaderpacks. Some browsers automatically unzip the downloaded file, in that case move the unzipped folder into your shaderpacks folder and make sure that the folder structure looks like this:
- shaderpacks - [Shaderpack name] - shaders
If the shaderpacks folder does not exist, run the game once or just manually create it. Then, load up the game and select it from options > video settings > shaders. Usually the Shaderpacks also have additional options that can be configured. These options can be found under "shader options" in the shader selection screen.