Sid Phillips started out his life, just like any other young boy. He grew up playing with toy soldiers, cars, trucks, etc. And like any other boy his age, he was fascinated with things such as war, and demolition derbies. So as he played with his toys, there was often crashing together of cars, soldiers fighting or and occasionally getting ran over. But toys, are inanimate objects, so why would it matter? But from what the movie shows us, when people are not around, that's clearly not the case.
One night Sid fell asleep on the couch early in the evening, at bed time his parents told him to go to sleep in his own room, so he headed up the stairs half asleep. As he approached his room, in what he thought was a dream, he overheard his toys obliviously talking about their discontentment with how they were being treated by him and how they wished he would stop. The next morning, still frightened from his "dream," Sid set out to dismantle or manipulate his toys so they were not a threat to him.
As the fear from the dream wore off, he still found enjoyment in blowing up toys and performing operations on them. Since he still had most of the parts from the toys that he dismantled, he began getting creative with them, combining mismatched parts to make new, scarier toys. As time went on, he did more and more harm to his toys. His toys were getting more and more upset, but the thought of what Sid would do to them if they did anything kept them dormant as it carried on for over two years.
A bit further down the road, Sid won Buzz and Woody from an arcade game that they had accidentally gotten into. Buzz and Woody, having already been owned by loving Andy and seeing the atrocities that Sid had committed on his own toys, knew that they had to do something to escape and get back to Andy. They could not escape Sid's grasp soon enough and Sid decided that he was going to send Spaceman Buzz for a little ride on a rocket. Woody quickly demised a precisely timed plan that would not only free Buzz from his soon fate, but also Sid's toys from their continued abuse.
Right as Sid was about to light the rocket duct taped to Buzz's back, Woody and his gang executed their plan, bringing Sid's nightmare to life. The toys confronted him and the mutilated toys that he created put the scare in him for good. He was too scared to be near the toys, let alone get his revenge.