The website that barba mentions will have all of your answers.
The first things that you should learn are how to properly clean and lubricate the chain. Checking and pumping up your tires. And, as you have already discovered, how to fix a flat. For any of this to work, you need to have the proper tools with you. Knowing how to change a tube won't help if you are 20 miles away from home without a spare or a patch kit.
It is all pretty easy stuff.