Is it possible you're thinking of the 1997-1998 film, Star Kid?
Spencer Griffith (Joseph Mazzello) is a shy seventh grader and 12-year-old boy. He has a crush on a school girl named Michelle (Lauren Eckstrom). Spencer's life changes when a mysterious meteorite crashes into a nearby junkyard. Investigating the site, he finds that the "meteorite" is actually a small rocket carrying a "Cyborsuit.", a prototype exoskeletal-suit with AI (short for Artificial Intelligence) from another galaxy. Spencer then decides to try the suit on and melds with the suit AI, who Spencer calls "Cy". After testing most of the functions and abilities of the suit, he then goes around town doing whatever he wants, such as getting back at a school bully Turbo (Joey Simmrin), rescuing Michelle and her friends from a damaged ferris wheel, and ordering food from a fast-food restaurant drive-thru, along with a few hilarious antics such as trashing his house while getting his head stuck in a refrigerator, figuring out how to eat a hamburger through the suit and wanting to get out of the suit to pee when Cy wouldn't let him.
During this time, Earth gets visited by a Broodwarrior (Brian Simpson), a member of an alien race of insectoids waging a war against the creator of the Cyborsuit, Tenris De'Thar and his fellow Trelkins. The Broodwarrior's mission is to capture the Cyborsuit so that his race can analyze it. After his first encounter with the Broodwarrior, Spencer escapes, forces Cy to eject him out of the suit and then abandons Cy telling him that he's afraid that he might not live to see his next birthday if he "engages" the Broodwarrior. Back at home, after Spencer looks over his comic book titled MidKnight Warrior and thinking about what kind of person he wants to be, he goes back out to find Cy only to find out that Cy was captured by the Broodwarrior. Spencer begins searching for Cy accompanied by Turbo, now becoming his friend. As they head to the junkyard, where Cy is about to be taken off-world by the Broodwarrior, they create a plan to distract the Broodwarrior long enough for Spencer to rescue Cy. Spencer gets Cy back and begins battling with the Broodwarrior.
....
With the Broodwarrior now destroyed, they return to Cy but it appears they were too late to save him. Just when Spencer begins to lose hope, Cy's creator Tenris De'Thar and Trelkin soldiers appear from a giant UFO and quickly repair him, bringing him back to life. After Cy and Spencer say goodbye to one another, one of the aliens gives Spencer a badge for his bravery and courage before their departure back to their home-world. The next day at school, a now confident Spencer, with encouragement from his new friend Turbo, starts up a conversation with Michelle.
Trailer