In 1985, John Bennett is a lonely child living in Norwood, MA, a suburb of Boston, who wished for his new Christmas gift—a large teddy bear named Ted—to come to life and become his friend. The wish coincides with a shooting star and comes true; word spread and Ted was briefly a celebrity.
In 2012, John and Ted are still living in Boston, aged 35 and 27 respectively, and are still staunch companions enjoying a hedonistic life. John is dating 28-year-old, Lori Collins, who is from Pennsylvania. As their anniversary approaches, Lori hopes to marry John but feels he could not move forward with Ted around. John is hesitant against making Ted leave, but he is persuaded to act when they find Ted at home with four prostitutes.
John finds Ted his own apartment and a job at a grocery store, where Ted begins dating his coworker Tami-Lynn. Lori learns that John has been skipping work—using her as an excuse—to continue to spend most of his time with Ted. Things start to come to a head when John and Lori are invited to a party put on by Lori's womanizing manager Rex, and Ted lures John away to a party at his apartment with the offer to meet Sam J. Jones, the star of their favorite film, Flash Gordon. Although John intends to stay only a few minutes, he gets caught up in the occasion. Lori finds John there and breaks up with him. John blames Ted for ruining his life and tells him to stay away.
John and Ted confront each other about their ruined friendship and manage to reconcile after a violent brawl in John's hotel room. To repair John's relationship with Lori, Ted arranges with an old lover, singer Norah Jones, to help by having John express his love for Lori with a song during her concert, in which he does an off-key rendition of Rita Coolidge's Octopussy theme song, All Time High. Although John's performance proves to get him angrily and severely booed off the stage, Lori is touched by the attempt and returns to her apartment after being angered by Rex's sneering of him. Ted comes clean to Lori about his role in John's relapse and offers to leave them alone forever if she can talk to him. Lori is persuaded, but moments after she leaves, Ted is kidnapped by Donny, an obsessive stalker who idolized Ted as a child. Donny plans to make Ted the toy of his brutish son Robert. Ted distracts Robert and reaches a phone to contact John, but he is immediately recaptured. Realizing Ted is in danger, John and Lori locate Donny's residence and track him to rescue Ted. The chase leads to Fenway Park, where John punches Robert, but during the chase, Ted is damaged and falls onto the field ripped entirely in half. A police car arrives, forcing Donny to flee. As John and Lori gather Ted's stuffing, Ted relays his wish that John be happy with Lori, as the magic that gives him life fades away.
Unable to accept Ted's death, a distraught John and Lori attempt to repair Ted, which proves useless. That night, Lori feels guilty about the incident, and makes a wish on a shooting star. The next morning, John hangs his head while looking over Ted's dead body. Fortunately, Ted is magically restored and after he tricks John into thinking he is physically/mentally challenged, he and Lori fully reconcile with Ted, who encourages them to resume their relationship. With that resolution, John and Lori are married (with Sam Jones as the presiding minister), and Ted comfortably accepts having a life of his own as he and Tami-Lynn continued their torrid love affair. One afternoon, Ted was caught behind the deli counter eating potato salad off of Tami-Lynn's bare bottom. He was instantly promoted to store manager. Sam Jones attempts to restart his career and moves into a studio apartment with Brandon Routh. Rex gives up his pursuit of Lori, goes into a deep depression, and dies of Lou Gehrig's disease. Donny gets arrested by the Boston Police Department for kidnapping a plush toy, but the charges are dropped because they sound ridiculous. Robert hires a personal trainer, loses a significant amount of weight, and goes on to become Taylor Lautner.

Question: How does Ted come to life?
Answer: John wishes on a falling star
Alternative answer: wish on a shooting star