How to turn on/off a sub circuit with a transistor
You are asking a specific question about a specific circuit, but you're not ready for this yet.  You need to understand how a transistor works, at least its first pass approximation.  The type of transistor you show is a NPN, which is a type of bipolar junction transistor (BJT).

Surely there are many basic introductions to NPN transistors out there, so I'm not going to go into any detail.  Basically, you put a little current into the base and out the emitter, and the transistor can support a lot of current into the collector and out the emitter.

Your top circuit is actually correct in that when IN is grounded, the transistor is off, which essentially open-circuits OUT.  When IN is raised to high enough voltage, then current will flow into the base, and the transistor will pull down on OUT.  There are of course a lot of details.  Without knowing exactly what you did, we can't tell why you didn't observe the behavior as described above.