Funerals were ceremonial actions associated with the body of a dead humanoid. Funerals often differed across cultures and could play an important role in religious beliefs.
Officers in Starfleet often decided to have a traditional Earth "burial at sea", changed for starships to a burial in space. The deceased was put in a photon torpedo casing, with the flag of the Federation (or in some cases, the flag of Starfleet Command) draped across it. A senior officer or someone close to the deceased usually said a eulogy, after which another officer blew a Boatswain's whistle as those gathered for the funeral stood at attention. The torpedo casket was then launched or beamed into open space. (Star Trek II: The Wrath of Khan; DS9: "Tears of the Prophets"; VOY: "Alliances", "One Small Step", "Ashes to Ashes"; ENT: "Similitude")
In 2376, the Starfleet practice of burial in space directly conflicted with the Kobali practice of salvaging corpses for reanimation as a means of procreation. The body of the late Ensign Lyndsay Ballard of the USS Voyager, who died and was buried in space in 2374, was reanimated to become Jhet'leya. (VOY: "Ashes to Ashes")
Civilians were known, according to their wishes, to receive a similar burial, except they were placed inside a different kind of container and beamed into space. (TNG: "The Schizoid Man")
In 2369 a private Ferengi funeral was held at Quark's after the death of Zek. (DS9: "The Nagus")
Gul Dukat told Constable Odo that he attended the funeral for Gul Darhe'el, held on Cardassia. Darhe'el was buried under one of the largest military monuments. (DS9: "Duet")
A wake was an old Irish tradition that involved people staying with a person's body until the funeral. (DS9: "The Ship", "The Sound of Her Voice")
Another similar practice was the memorial. One was held for Morn on Deep Space 9 in 2374. (DS9: "Who Mourns for Morn?")