For the simplest way just follow these steps
Go to File -> New -> Import Module -> choose library or project folder
Add library to include section in settings.gradle file and sync the project (After that you can see new folder with library name is added in project structure)
include ':mylibraryName'
Go to File -> Project Structure -> app -> dependency tab -> click on plus button
Select module dependency -> select library (your library name should appear there) and put scope (compile or implementation)
Add this line in build.gradle in app level module in dependency section
implementation project(':mylibraryName')