Yes, it looks like you did that correctly, since it is attempting to install the HCMotor library. However, as the next line of the compile output says, you need to now install the Git client, so that PlatformIO can work with git repositories. You have two options, you can do what the error message says, and install git:
In other words, goto Git - Downloads and download the version of git for your operating system - i.e. Windows. Install it, and restart VSCode if you had it running still. PlatformIO should then find Git, and carry one.
Or, you can install the library via a zip file - the same way you would download a repo on GitHub if you dont’ have the git client. If you want to do that instead, change your lib_deps
line to lib_deps = https://github.com/HobbyComponents/HCMotor/archive/master.zip
, and building it try again! I would still however recommend installing and using Git, as that will allow for only changes to libraries and file to be downloaded, rather than having to re-download everything, whenever there are any updates.