The toilet, also referred to by the Ferengi as a waste extraction fixture, was a device used for the disposal of bodily wastes. The waste extraction system was the system used to manage and process that and all other related wastes.
During the first mission of the starship Enterprise NX-01 in April 2151, Captain Jonathan Archer declared that the Vulcan High Command didn't think Humans could flush a toilet without a Vulcan to assist. (ENT: "Broken Bow")
In 2151, Worley Elementary School in Kenmare, County Kerry, Ireland on Earth, sent questions, letters, and drawings to the Enterprise. One question asked was "When you flush the toilet, where does it go?" and one of the few that was answered personally – Captain Archer delegated it to chief engineer Trip Tucker. Commander Tucker was not pleased with the captain's selection of questions for him and protested, but ultimately relented and explained to Molly the ship's processes of recycling and biomatter resequencing. (ENT: "Breaking the Ice")
The decon chamber on Enterprise NX-01 had its own toilet, housed in a separate chamber within the decontamination area. In 2154, Hoshi Sato vomited in this toilet while dying of the Silicon-based virus. (ENT: "Observer Effect")
The brig aboard Starfleet ships included facilities such as a sink and toilet, which were enclosed behind the wall until needed. A sign above the toilet read "do not use while in spacedock." (Star Trek V: The Final Frontier)
Waste extraction points on a Bajoran transport are located in individual quarters. After Ibudan was murdered in 2369, Dr. Julian Bashir located seofurane fragments near the waste extraction point in Ibudan's quarters on the transport. (DS9: "A Man Alone")
It was said that the waste extraction fixtures at the Nagal Residence on Ferenginar were plated with latinum. Quark, believing that he was about to become the next Grand Nagus, said that the first thing he was going to rip out the plated fixtures and replace them with solid latinum fixtures. (DS9: "Body Parts", "The Dogs of War")
A latrine was an improvised toilet. In 2152, while riding out a neutronic storm, Travis Mayweather asked Trip Tucker what they would do for a latrine. Tucker suggested converting some of the storage lockers in the aft compartment. (ENT: "The Catwalk") In 2154, Hoshi Sato reported that a latrine was among the remnants of a Klingon garbage dump. (ENT: "Observer Effect")
The Star Trek: Legacies novel Best Defense reveals that Starfleet away teams had portable commodes they could use while planetside. Montgomery Scott rigs up one of them to stun the woman who has demanded the device, among other things, while holding Joanna McCoy hostage. Spock ruefully observes that the move was lacking dignity. It was ultimately unnecessary.