You can start by reading up the RFC governing the FTP protocol. With that you can get an idea on how the FTP protocol works, how it sends commands, expected responses etc.
You can find a link here: https://www.rfc-editor.org/rfc/rfc959
Aside from that you can have a look at this GitHub repository. In there you’ll find a simple FTP client that I wrote back when I was in uni. The FtpConnection
class implements most of the commands you’ll need to do your job.
Have a look at it and how these are used.
solved Implemeting a basic FTP client in Java