If you have a “vanilla” Minecraft ( not modded ), in order to run mods you need a loader.
One of them is “Fabric” and here is how you set it up on a vanilla Minecraft.
First, download the Fabric installer from https://fabricmc.net/use/installer/.
Then download the Fabric API from https://modrinth.com/mod/fabric-api/versions.
Select the latest one marked as “release” like this example:

Next, make sure the Minecraft is closed, and run Fabric installer:

Note down the installation location – we will need that later.

Once the installation is completed, open the installation location in file explorer
by typing “explorer %appdata%\.minecraft” in the search bar or the command prompt:

When the folder opens, right click on a blank space and select “New -> Folder”. Name folder “mods”.

Open the “mods” folder and copy the downloaded API jar file into it:

Launch Minecraft. You will now have a “fabric-loader-xxxxx” option selected:
