It’s hard, but sometimes you’ve got to do it. If it’s a close friend, you really should talk with them, and be honest but as gentle as you can. Sometimes (only if it is the truth), you can leave the door open for renewing the friendship when things change in your lives; it does happen, even after bad friend breakups. Though “ghosting” or just disappearing from someone’s life is currently in disfavor, you can gradually reduce your contact with less close friends and the friendship often just fades away.