Using ssh in Terminal would be my preferred way to achieve this but your friend will likely need to setup a rule on their firewall/router to let you make inbound ssh connections to their Mac.
Once you're in it's the same as being in a Terminal locally on their Mac so you have full control over their filesystem (assuming you login with their credentials). Your friend could create another account for you to login with but you'll need Administrative rights on that account to use sudo to manipulate files in their home directory.
IPV4 with NAT will require a port 22 forward on their router to the internal IP address of their Mac. If IPv6 is available to you both then it will likely just need a hole poked in your friends firewall/router to allow return traffic to your own IP. If your friend's Mac is not in a fixed network location and is moving around and changing networks then this method won't work.
If you're new to this I would suggest trying this out on the same network first before you try doing it over the internet and have their firewall/router in the way.
To enable ssh login on your friends Mac go to System Preferences -> Sharing and enable Remote Login.
To ssh to your friends laptop in a Terminal you'll want something like:
in a Terminal on your machine where username is their 'shortname' on their Mac and ipaddress is their public IP. Typing
into a Terminal on their Mac is a quick and easy way to determine their 'shortname'. It's the name in brackets after the uid.
The password required will be the same as their normal desktop login password.
Once you're logged in via ssh you have access to all the tools you would be able to use in Terminal on their local machine (like cp, mv, rm etc).
If you use this method and get things working and you want to leave Remote Login on all the time you should consider generating and using ssh keys and disable ssh password based logins altogether. Open ssh ports tend to attract lots of attention.
Ideally you should also make the firewall rules on their firewall/router specific to your public IP, though that can be a pain if your public IP is assigned dynamically by your ISP or you move network locations a lot.