I always look at transistors as a way to separate voltage flow from the delicate controls.
But yeah, google will explain it much better than I can blabber on about :P
Always look up the datasheet as the pin layout could possibly be different. just lookup the code, say like 2n3904.
This is a helpful page as well.
I've mainly used mine as switches to increase the current flow vs a uProc pin that is usually rated very low.