Five different kinds of thing, five different folders. Find the one you have and follow that section - the rest will not apply.
A Fabric mod is a .jar file. It needs the Fabric loader installed for the same Minecraft version, and almost always the Fabric API mod alongside it.
Versions have to match exactly. A mod for 1.20.1 will not load on 1.20.4, and the game usually closes rather than explaining. Every product here lists the versions it supports.
Same shape as Fabric, different loader. NeoForge is the continuation of Forge for 1.20.2 and later; Forge is what you want for older versions. They are not interchangeable, and a mod built for one will not load on the other.
If you use a third-party launcher - Prism, MultiMC, the CurseForge app - each instance has its own mods folder rather than sharing one. Put the file in the instance you are actually going to play.
A datapack is a .zip that changes how a world behaves - recipes, loot, advancements, structure generation. It does not need a mod loader, and it goes inside one world rather than into the game as a whole.
The same folder, one level in from the server directory: <server>/world/datapacks. Run /reload from the console afterwards.
A datapack applies to one world. Creating a new world does not carry it over - it needs adding again, which is the single most common reason one appears to have stopped working.
A plugin is a .jar that runs on the server only. Players joining need nothing installed, which is the whole reason plugins exist - and it is why a plugin will do nothing at all if you put it in a normal single-player game.
If you rent a server, the host's control panel has a file manager or an FTP login that reaches the same plugins folder.
The folder is hidden by default on every platform, which is why it is hard to find rather than because it is anywhere unusual.
In the official launcher you can also open Installations, press the three dots beside a profile and choose the folder option, which opens the right directory for that installation - useful when you have several.
The three things worth checking before anything else: the Minecraft version matches exactly, the loader matches (Fabric mods do not run on Forge), and Fabric API is installed if it is a Fabric mod.
After that, open a support ticket with It will not install as the topic. Say which product, which Minecraft version and which loader, and paste the crash log if there is one - that is enough to answer almost every one of these in a single reply.