Obi-Wan Kenobi plays this role in Episode IV, which is mirrored by Qui-Gon Jinn in Episode I.
Mace Windu in Episode III.
Russel Franklin, Samuel L. Jackson's character in Deep Blue Sea. Most of the first half of the movie is character development for this man. You get to know him. Get to know how adventuresome and noble and kind-hearted but not naive he is. He is obviously the hero... or at least a decent secondary protagonist. He even gets to give a moving speech about how they'll all get out of there alive if they just pull together! And then out of the blue, a shark eats him.
Every Scream movie has at least one of these, a lot of the time to set up the final act.
Scream 2: Randy and Hallie.
Scream 3: Averted with Dewey and Gale, who survive, but are nearly killed when Ghostface threatens to murder them unless Sidney shows up.
Hoban Washburn, pilot extraordinaire, is a perfect example given that the creator of the film admitted he killed the man off just to make the Reavers look even more dangerous and to break the PC Shield.
Which makes Shepherd Book's death an example as well, killed to make The Operative look even more dangerous.
In the sequel, Dungeons & Dragons: Wrath of the Dragon God, Dorian the Cleric bites the dust after getting frozen, eaten and then exploded by a White Dragon... Interestingly, nearly everyone else in the party gets horribly wounded and maimed in every single scene after that, when having a Cleric would have been nice.
Benicio del Toro admitted in the DVD commentary that this was his character's purposes in The Usual Suspects. He also said he added the accent and the behavior, because if he had to die, he at least wanted to be memorable.
In the 1988 remake of The Blob we follow the character of Paul throughout the first half of the movie and we slowly get to know him, but then he's the second person to be consumed by the blob.
Gabriel, the son of Mel Gibson's protagonist character Benjamin Martin in The Patriot, gets a good amount of screen time and character development establishing him as a secondary protagonist. Then Gabriel's love interest and her family are burned to death when the film's Big Bad Tavington locks them in a church and sets it on fire. Gabriel attempts to get vengeance on Tavington, but is instead stabbed to death by Tavington in the fight. Of course, Tavington already crossed the Moral Event Horizon with the church-burning incident, so Gabriel's death basically serves to remind us that it's Mel Gibson's character who's the protagonist, and only he is allowed to finally kill Tavington at the end. Gabriel's death just gives Benjamin Martin added motivation.
Batman Begins has the Nice Guy District Attorney Carl Finch who seems like he will be important in bringing Carmine Falcone to justice and has dated Rachel Dawes in the past. He gets unceremoniously shot down by League of Shadows members disguised as cops.
Foley from the Dark Knight Rises, who has to be inspired by (Robin) John Blake to put back on his uniform and help defend the city of Gotham against the League of Shadows.
Parody movie Amazon Women on the Moon has an interesting take on this. An astronaut's character development is alluded to, and is killed about halfway through the movie, but none of this is actually shown due to the film reel being faulty.
Lt. Hawk in Star Trek: First Contact, while not getting an extreme amount of screen time he was presented as basically Worf's replacement onboard the Enterprise-E while Worf was stationed at Deep Space Nine.
Liam Neeson's Godfrey in Kingdom of Heaven. Godfrey is wounded about 15 minutes into the film and dies before the 30 minute mark, thus catalyzing his son Balian's new life in the Holy Lands and the main plot of the film. What made Godfrey's death so unexpected was that Liam Neeson was promoted as one of the biggest and most important names in the film (though considering he's a Chronically Killed Actor some people may have seen it coming).
The movie version of L.A. Confidential alternates its focus between the three cops Ed Exley, Bud White, and Jack Vincennes, establishing the characters' different approaches to their duties and their overall personality. Then Jack Vincennes is shot to death in the middle of the third act, letting us know this is a film where Anyone Can Die.
28 Weeks Later has at least three. Firstly, it looks like Robert Carlyle's character, Don, is going to be the main protagonist, since, at the time of release, he was the biggest name in the film, and most of the promotional material focused on him. However, he's actually the first person infected by the zombie virus. Then Scarlet, a scientist looking for a cure, and Doyle, a soldier who helps them, are the new protagonists. Doyle performs a Heroic Sacrifice pretty soon, and Scarlet is killed by, ironically enough, Don, the film's first Sacrificial Lion.
And the first film has Frank, infected halfway through.
In the 2009 Star Trek film it establishes early on that the second-in-command is George Kirk, Jim Kirk's father. The (memorable) Captain promotes Kirk to captain, implying that he knows full well he won't make it back alive from the meeting with the Romulans in the super-powerful ship. Once the ship resumes attacking George Kirk orders an evacuation and stays behind to fight off the Romulans, eventually making suicide run. Spock's mother, too, is killed when Vulcan is destroyed, both of which reinforce that anything can happen in this timeline.
The Kid (Leonardo DiCaprio's character) from The Quick and the Dead gets so much face time he's one of the films Ensemble Darkhorses, but in the end he's gut-shot and left to die in the street simply to show that Harod's so evil he'd kill his own son just to finish a gunfight contest.
Reservoir Dogs, with Mr. Blonde being shot by Mr. Orange. An inversion since he's the good guy, but it's the first death of a main character, and it ups the ante from will Orange get treatment in time and will the cops bust in, to who will survive.
Alien³: When Ripley first crash lands on the prison planet, she is treated by Charles Dance's kindly doctor/former inmate Clemens. As the film progresses, the two form an increasingly close bond and eventually sleep together, implying that Clemens will be a major character and, at the very least, be given a Heroic Sacrifice towards the end - then the alien appears, and Clemens is one of the first to die.
Alien: Resurrection: Don't get too attached to Michael Wincott's badass ship captain - far from being the grizzlier, outlaw counterpart to the second movie's Corporal Hicks as he first appears, he's the first of the smugglers to get chomped when the aliens escape their holding cells.
Ironhide is killed by the treacherous Sentinel Prime in Transformers: Dark of the Moon (immediately following an awesome Mexican Standoff scene with the 'Cons) by being shot in the back. He has enough time to ask "Why" before Sentinel sadistically "releases" the soldier from duty. It comes as especially shocking as up until then Sentinel was portrayed as an almost grandfatherly figure and mentor to Optimus.
Tracy from On Her Majesty's Secret Service is arguably the best known of the lot, though her death doesn't truly have an effect on Bond until Licence to Kill, where another wedding ends in tragedy and leaves another lion, Felix Lieter, mauled.
The subtext of the subsequent discussion of and allusions to his death also hints that he's the thing that "the Avengers" (until this moment only a government codename) are going to be, well, avenging from now on.
Tatsuo in Kamikaze Taxi
The two main protagonists of The Rock are a prisoner who isn't allowed to carry a gun and an FBI chemical weapons specialist who has to borrow one for the mission. Both survive the film. The SEAL team they're assigned to, expected to do all the heavy fighting, is wiped out in an ambush soon after they reach Alcatraz.
In Air Force One, Major Caldwell gets a lot of screen time and a lot of character development. And then, just as the movie ends, he's killed defending the president from the traitorous Agent Gibbs.
Robert Muldoon in Jurassic Park is given more screentime and like ability factor than most of the Red Shirt type characters that are usually eaten by the creatures in these kinds of films. He is also portrayed as "knowing more about Raptors than anyone" and being a Badass who will likely have an ultimate showdown with the Raptors. However, in the end he is ambushed and killed by the clever girls.
Pacific Rim: Appears to be the case with both Cherno Alpha and Crimson Typhoon who are destroyed during the battle of Hong Kong.
Gravity does away with George Clooney little more than half an hour into the film. It is from the same director who made Children of Men, after all.
Luca Brasi is introduced in The Godfather, both the film and the novel, as this terrifying killer and enforcer for the Corleones, more force of nature than man. He is killed by Virgil Sollozzo and Bruno Tattaglia without very much difficulty as the opening gambit of their war with the Corleones. When the Corleones receive a fish wrapped in Brasi's bulletproof vest, they know they are in trouble.
Joe Brody gets the most development early on in Godzilla (2014), but is killed when the first Muto awakens.