If you're on a budget try cleaning the chain first. There are some youtube videos & instructions that show how to clean your chain. Like this one by Georgena Terry.
Otherwise replace the chain and then clean it frequently. Every time I clean my chain it leaves black gunk on the rag, I clean it until the black coming off the chain onto the rag starts to fade. (I guess I should clean it until the chain stops leaving any black gunk, but it takes forever just to get it to this point. And I do clean my chain frequently. I just use my bike pretty hard, in all weather.)
If you're pretty inexperienced at this feel free to ask us more questions. I could go into a lot more detail about how I do it, but I don't want to bore you if you already know.
2009 Trek 7.2FX WSD, brooks Champion Flyer S, commuter bike