A funeral is a ceremony marking the death of an individual. The nature of an individual's funeral depends on a person's culture, religious beliefs, and personal preferences. Funerals can vary from very simple to quite complex. A funeral often, but not always, takes place just before the final disposition of an individual's remains - which can include burial or cremation. In most cases the person's remains are present at the funeral, unless the body had been destroyed or otherwise could not be retrieved beforehand.
In 2294, a funeral service was held for Demora Sulu after her apparent death. After a service at the Starfleet chapel, a grieving Pavel Chekov got into a fight with John Harriman, whom he considered responsible for Demora's death. Following this, the body was taken on board the USS Enterprise-B and launched into the sun. It was later revealed that it was not Demora who died, but a mindless clone created by an old enemy of her father. Chekov was reprimanded for his actions. (TOS novel: The Captain's Daughter)
Klingons usually had very simple funerals. The Klingon death ritual was carried out almost immediately after the death of a warrior. In this ceremony the other Klingon warriors would open and look into the dying Klingon's eyes, then raise their heads and howl to warn the dead that a Klingon warrior was about to arrive. Not all Klingons had this done: Azetbur decided against having the ritual performed for her father after his assassination. After the ritual was performed, the body was considered to be only an empty shell and disposed of soon afterwards. (TOS novelization: Star Trek VI: The Undiscovered Country and TNG episode: "Heart of Glory")
When a Romulan phasing cloak interacted with the transporters on board the USS Enterprise-D, Geordi La Forge and Ro Laren were cloaked and phased while beaming from a crippled Romulan ship to the Enterprise. The Enterprise crew believed both had died in a transporter accident. Data asked for and received permission from Captain Picard to plan an appropriate memorial service for La Forge and Ro, and held a New Orleans style service for the two, who figured out how to return to normal during the service in time to keep the Enterprise from being destroyed. (TNG episode: "The Next Phase").