It would be professional and ethical for you to inform the company on mail, as soon as possible.
This would give them time to adjust their candidates list and the relevant priority in it before getting ready to interview the remaining candidates.
Leave a mail to the person you are in contact with. I would also advise you to leave a message to them on LinkedIn (if the person you are in contact with is a HR). This would help you get the message much quickly.
Doing so would not be considered unprofessional, and the company would not black list you.
I would also advise you to give a call to the person, if you do not get a reply on mail/Linkedin by the end of day. This would help in confirming your withdrawal, in case he/she haven't checked their mail.