Go to the Oracle Java website
and pick Java 17

Pick your operating system (Windows, macOS, or Linux):

Download the installer and run it:

Go to the Prism Launcher website and hit the
download button:

Download the installer and follow its instructions.
Open the Prism Launcher, click on the Minecraft Skin icon on the top right,
and hit “Manage Accounts”

Hit “Add Microsoft” and follow the instructions to log in with your
Microsoft account.

Right click the modpack and hit “Edit…”

Go to Settings, tick the “Java installation” box, and press the
Auto-detect button.

Pick a Java version that is 17, and hit OK.

You’re now good to go! Close the settings, then double-click the modpack (or hit the launch button) to start.