Yes you can use the cpanel ftp/file editor if you want, but I would recommend an external one like Filezilla. Since this is sort of an emergency and you need to get the site back up fast, you could just use the cpanel file editor for now since its already setup with your site.
Depending on your host, you may see a folder called “public_html” or something similar, then you should see your site name/url. Once you click into your site folder, look for “wp-content” then “themes” then “Legacy”. The functions.php file will be inside Legacy. You’ll need to replace it with the original functions.php (this can be found in your theme that you have saved on your computer). You could also see if you can edit the functions file if cpanel allows you to (try right click, edit…or look for an edit button). If it does then you can go in and delete the code you added earlier and click save to see if your site restores.