This is how I do it (PlatformIO & VS code):
Create a new project and add the library to the lib_deps in platformio.ini:
lib_deps = https://github.com/username/repository
.
The library is then automatically cloned under .pio/<environment-name>/libdeps/<library-name>/
.
In this folder you can make changes to the library and test these changes it in your project.
In VS code, the changes can then be comitted via the source control panel and pushed to github.