Here are some common reasons why Minecraft crashes or lags when graphics are used, along with some possible fixes. First, think about the limits of your hardware. Make sure that your graphics card meets the base system requirements for the shader pack. RAM is also very important for making graphics work well, so give Minecraft more RAM if it needs it. Also, make sure that your GPU has enough memory to handle the shader pack.
Next, make sure that the image pack works with it. Make sure that the texture pack works with the version of Minecraft you're using. Packs that are too old or don't work with your version can make the game unstable. Crashing can also happen when mods clash with each other. To find any conflicts, try briefly turning off other mods.
If the speed problems don't go away, change the settings for your shader pack. Lowering settings like quality, size, and effects can make things run much faster. A lot of shader packs have choices for compatibility that help hardware that isn't very powerful run them smoothly.
Changing the settings for Minecraft can also make a big difference. Lessen the view distance and the graphics settings to make the rendering load on your machine lighter. By making these changes, you can help keep the frame rate fixed while using shaders.
Last but not least, make sure your program and drivers are up to date. Stability problems are often caused by graphics card drivers that are too old. Close any background programs that you don't need to free up space, and turn off your antivirus or firewall for a short time to see if they are getting in the way of Minecraft.
Do you have another way to solve it? We'd love to hear from you in the comments.