The Library Manager is the simplest and safest way to install libraries. If possible, that is the method you should use.
If the library you want to use is not available via the library manager, you can get the source code and place it into your machine's local library folder. The location of the folder is rather specific.
See the file hierarchy below:
It is important to install your libraries in the correct location. Otherwise the compiler will not be able to locate them when you try to compile and upload your sketches.
Your sketchbook folder is the folder where the Arduino IDE stores your sketches. This folder is automatically created by the IDE when you install it.
On Linux machines, the folder is named "Sketchbook" and it is typically located in /home/
On Windows and Macintosh machines, the default name of the folder is "Arduino" and is located in your Documents folder.
User installed libraries should go in a folder named Libraries, located inside your sketchbook folder. This is where the IDE will look for user installed libraries.
Open the Preferences Dialog
Click File -> Preferences in the IDE.
Find the Sketchbook Location
Usually a folder named Arduino in your Documents folder.
Create a Libraries Folder
If there is no Libraries folder there, create one.
Rename to Libraries
Right click on the New Folder and select Rename. Then type in Libraries.