A barn was a building used for storing livestock and farm tools on farms.
In 2267, Lieutenant Kelowitz noted to Hikaru Sulu that a barn on Omicron Ceti III was only used for storage, not cows. (TOS: "This Side of Paradise")
In 2268, an imprisoned James T. Kirk told Spock to hurry up and shoot, saying he didn't care if Spock could hit the broad side of a barn, after which Spock, in typical Vulcan fashion, asked why he should aim at such a structure. (TOS: "Patterns of Force")
In 2285, Kirk compared Montgomery Scott's repairs after it was too late to fixing the barn door after the horse has come home. (Star Trek III: The Search for Spock)
In 2367, when Data expressed incredulity at the illogic of running towards ones own destruction, Deanna Troi reminded him that horses sometimes ran into a burning barn. (TNG: "The Loss")
In 2371, while in the Nexus, Kirk showed Jean-Luc Picard a replica of his uncle's barn in Idaho. (Star Trek Generations)
In 2375, Frankie Eyes asked Vic Fontaine whether he had been born in a barn. (DS9: "Badda-Bing, Badda-Bang")