You could set the story in an isolated location where there are no other people. Or maybe have a supernatural element that makes everyone disappear.
One way could be to focus on the main character's internal thoughts and experiences, minimizing mentions of others. Another option is to create a situation where everyone is away or unavailable for some reason. For example, it could be a post-apocalyptic world where most people have died or fled.
You might consider using a narrative device like a dream sequence or a vision where only the protagonist is present. Or make the story take place during a time when everyone is otherwise occupied and not part of the immediate events.