What I want to say in English:
In Citizenship, you learn how the prisons work.
Would the correct way to translate this be:
In Gemeinschaftskunde lernt man, wie die Gefängnisse funktionieren.
Or:
In Gemeinschaftskunde lernt man, wie die Gefängnisse zu funktionieren.
Or neither!
When answering, it would be great if you could also go into detail about why the translation is correct (like a general rule, or something).