Example answer:
Dear [their first name],
I hope you are having a wonderful day.
I wanted to let you know that I have received and accepted an offer from a different organisation. It is an exceptional opportunity that was difficult to turn down. As a result, I won’t be able to attend the interview on [date] at [time].
I also wanted to say thank you. I have thoroughly enjoyed the hiring process so far and getting to know you [include other people from the team if relevant]. It truly does seem like you’ve built an awesome team.
I would love to stay in touch and hope that we cross paths again in the near future.
Thank you again and keep well.
[your name]