Democracy: Democratic governments can take various forms, including both parliamentary and presidential systems, where the head of government is elected directly by the people (presidential) or by the legislative body (parliamentary).
Republic: A republic can encompass both democratic and non-democratic systems. For example, a republic can have an elected president who serves as the head of state, but the actual decision-making might be concentrated in a non-elected ruling elite.
The truth is actually simple: For all practical purposes, and in most contexts, “republic” and “democracy” are synonyms. The big difference is that the first comes from Latin and the latter from Greek. To say that the U.S. is a republic, not a democracy, is like claiming to eat beef and pork but not cows and pigs.