In order to keep your game clean and bug-free, the best way to go about mod installation is through the Forge client. Let's go through the steps needed to set up the environment for installing mods.
Click Use this template button and click Create a new repository. Finish creating repository. Clone the repository and open the repository folder with your IDE. Wait for the Gradle Sync.