In Ancient Greece, temples were built as "houses" for deities that also served as a place of worship. People would worship at a temple by bringing offerings that a particular god was believed to have favored- for example, leaving wine at the temple of Dionysus. Some people may have also cleaned and decorated the temple in service to the gods, or sang and danced outside in honor of the god. Most people did not go inside of the temples, at least not into the innermost chamber, because this was considered a sacred and private place. Instead, people would make their offerings from the outside or an outermost portion of the temple. In the Greek style, these temples varied from large structures like the Parthenon, to smaller community temples or even household shrines.
It is a little difficult for us modern-day people to understand how the Ancient Greeks related to and thought of their gods. It is possible that some people believed the literal, anthropomorphic embodiment of their gods to live inside of these temples. Most scholars feel it is more likely that people understood that their temples were dedicated to the idea of the god and everything they ruled. Many Ancient Greek gods could turn into animals or natural forces in the world, so a temple served sort of like a post-office box. People could make prayers and leave offerings at the temple and trust that they were received by the god, even if that deity didn't actually live there.
Many of these temples and their patron deities also offered a sense of communal identity. One city might be considered protected by a particular deity, and within that, people might choose to worship their communal or household deities as well. Which gods a person chose to interact with reflected their values in life.