To download a directory from a remote server to your machine you can use the scp -r command.
You shouldn’t be logged in to the remote machine at this point.
scp -r [email protected]:/path/to/folder /dest/local/path
Understanding how a programming language works is a surefire way to be a better developer. Read more.