Sans Gaster

Underground
Sans was created in 1983 by Dr. W. D. Gaster, who was attempting to revive the skeleton race, being the last living member. Sans was given life through both Determination, and a fragment of Gaster's SOUL, though the SOUL fragment had been damaged, making Sans extremely vulnerable to damage. Sans was gifted and intelligent, and eventually became Gaster's assistant while also helping to raise Papyrus after his creation. He considers Gaster to be his father, and is the only living being to remember Gaster's existence after the CORE incident that destroyed Gaster and his followers. Sans barely survived, and remained to stabilize the CORE after Alphys was named the next Royal Scientist. The two became close friends for a time until Sans left with Papyrus to start a new life in Snowdin. Through numerous timelines, he wound up battling and defeating Flowey during his reign of terror, and served the same purpose during Frisk's countless genocide runs, only being defeated by Frisk once out of a million different tries. Eventually, however, Sans convinced Frisk to give it up and just pick a path and stay with it, so Frisk remained underground. The damage the CORE suffered during the CORE incident, despite repairs, left it unstable, and it eventually began to fall apart, resulting in the evacuation of the underground. The barrier was shattered by the combined efforts of Frisk, Flowey, and the six human SOULs. The monsters barely escaped the eruption of Mt. Ebott.

The Surface
Not much is known about what Sans has been up to on the surface, outside of a change in attire (enforced by Papyrus), and a seemingly more vast spread of intelligence and sources. He's a lot less apathetic due to Frisk's loss of the timeline, letting his satisfaction of this development be known when revealed by Frisk, much to Flowey's annoyance. Sans presumably holds down multiple jobs like he did underground, though his occupations seem to be less well-known than before. Sans spends most of his time with Toriel, Frisk, and Papyrus during this time, evidently holding feelings for Toriel but the two never engage in a romance.

Episode 1 "A Happy Ending"
Sans first appears in Toriel's kitchen with Papyrus, exchanging jokes with Toriel that become borderline flirtatious before he offers to give Frisk a ride to school, which Toriel allows. Sans appears again when taking Frisk home from school, discussing Toriel's absence. His last appearance this episode is toward the end, when Asgore drops Frisk off at Sans' house to stay, where Sans takes care of Frisk in a way she's comfortable with.