Okay, so in SOMA you play in the future, around 75 years after 2015.
You play as Simon, someone with brain cancer during the 21st century/2015 and go into for a brain scan for a possible creation of a cure.
Simon goes into it, and wakes up 75 years in the future in the bottom of the ocean.
Throughout the game, it turns out that Simon is actually operating a robot diving suit, and his old body from 2015 died months after the brain scan. But the diving suit robot that is the new Simon doesn't recall any of that, since his memories only go up to when he went to the brain scan.
Near the end of the game, you need to put yourself into a different diving suit robot because of needing to go deeper. (pressure)
Issue is, the moment Simon transfers into the new suit, he hears himself talk.
Turns out, the way transferring works isn't a 1:1 transfer.
It instead completely copies your memories and places them into a new body.
So the Simon you've been playing as the entire game, is now strapped down in a chair unconscious, as you play as the new Simon. You get the option to either leave him by himself forever, or cut off his life support and kill what was basically the character you where playing as the entire game up until this point.
At the end of the game, you have to launch what's called the Ark, which is a satellite that'll go into space with the memories of previous humans. (Earth is dead during the game and this is the only way to preserve humanity)
Instead though, as shown previously, when Simon 2.0 tries to transfers his consciousness to the Ark, it launches without him.
That's because it worked, as it wasn't meant to transfer him 1:1 to the Ark, but instead make a copy of the current Simon and place it into the Ark.
So, you hear Simon 3.0 in the Ark celebrating and happy that they made it out, as your Simon, Simon 2.0 is left being scared and slowly dying from the underwater station crumbling. And that's how the game ends.
All four of these Simon's are seperate entities, and the game emphasises this. Especially when you can physically interact with Simon 1.0 with Simon 2.0. And hear Simon 3.0 celebrating and thinking they left the underwater station, as Simon 2.0 is left behind and scared.