In Star Wars: Knights of the Old Republic, on the summit of the Temple of the Ancients at the Unknown World, you will be confronted by Bastila, who has fallen to the dark side. During the confrontation you will be provided the opportunity to determine which ending you will get, and there will be consequences of your choice there.
If you choose the light side ending by rejecting Bastila's suggestion for you to reclaim the title of the Dark Lord of the Sith, you will face the fallen Bastila again in the Star Forge. Depending on your dialogue choices, you will either successfully convince Bastila to return to the light side, or you kill her if you fail to do so.
This guide will provide in-depth details on how the mechanics of redeeming Bastila on the Star Forge works, and which dialogue options will give you better chance in successfully redeeming Bastila.
Here is the link to my redeeming Bastila guide