I accidentally deleted the public_html or www folder

If you delete the www folder, your site should still load properly.

If you delete the public_html folder, you will need to restore your public_html directory from previous backup or from trash (if available). You can restore directly from cPanel, using the backup manager (R1Soft or JetBackup).