How to write stories with multiple endings

Hey, so I’ve been reading a ton of stories that have multiple endings and I was wondering how you do that.
Like if the reader gets a bad ending, they have to play the story all over again or having choices carry out in between episodes.

You can either use if/elif/else method or just use points between the choices