By someone playing the same part, or just by someone else who filled the same fuction? for instance, in Cheers, Nicholas Colasante died early in the run, and Woody Harrelson replaced him as a similar character. TV series, though, have the luxury of writing in a character’s death, so they can just replace him like that.
Vic Morrow died during the filming of Twilight Zone: The Movie. I believe they used a stand-in for a few final scenes.
Brandon Lee died during filming of The Crow. The producers used outtakes, a double, and digital composition to finish the film.
Jean Harlowe died during the filming of Saratoga. They used her stand-in* to double for her and shot scenes so her face wasn’t seen.
*Hollywood stand-ins in the 30s and 40s were chosen because they had the same hair and skin coloring as the star, as well as being the same height and build.