Routinely lubricating or greasing the bicycle chain will improve its performance and prevent premature wear. Choose a suitable lubricant for the bicycle depending on the conditions in which you are going to use it. Once you have a lubricant, you will need to clean the chain thoroughly before applying it. Then, you can apply the lubricant to the chain of your bicycle without problems. Once you've got the hang of it, you can start lubricating your bike chain in a matter of minutes.
Steps
Part 1 of 3: Choosing a Bicycle Lubricant

Step 1. Choose a wet lube if you are going to ride your bike during wet weather
Streets with rain, snow, and sleet can remove dried lubricant from the bicycle chain. The wet lubricant will be more resistant in these cases.
You can find bike lubricants of all kinds online or at a local bike store

Step 2. Use a dry lubricant if you live in an arid climate
Wet lube isn't necessary if you're riding in dry weather conditions, plus it attracts more dirt than dry lube. Dry lube will keep the chain cleaner, but you will need to reapply it often, usually every 50 to 100 miles (80 to 160 km) of travel.

Step 3. Get a wax lubricant if you ride the bike to get around
Wax lube is less messy than other types of bike lube, so it won't stain your clothes if you ride your bike to work or to the store. Wax lubricant also keeps the bike chain cleaner than other types of lubricants, as sand and dirt "loosen" from the wax compound.

Step 4. Do not lubricate the chain with WD-40
Use only lubricants specifically designed for bicycle chains. WD-40 is a fast evaporating solvent and only contains a small amount of lubricant. This product can cause dirt and grime to build up on the chain.
Part 2 of 3: Cleaning the bike chain

Step 1. Spray some degreasing spray or rubbing alcohol on an old rag
The rag will get dirty from the chain, so use one that you don't mind too much. You won't need a lot of degreaser or rubbing alcohol on the cloth, so a quick spray will do the trick.
Don't have degreasing spray or rubbing alcohol? You can clean the chain you want to lubricate with a dry cloth if it is not so dirty. If you still have dirt after this, you will need to go to a local hardware store to buy a degreaser spray or bottle of rubbing alcohol

Step 2. Place the rag against part of the bike chain
Hold the rag in place with your hand. The chain should touch the part of the rag that you sprayed with the degreaser or isopropyl alcohol.

Step 3. Move the pedals back so the chain goes through the rag
Grab one of the bike's pedals with your free hand and move it back. The chain will begin to move around the chainrings of the bike. Keep moving the pedals until the entire chain has slid through the rag several times. Keep the rag in place while you turn the chain.
Watch out for fingers that can get caught between the chain and the chainrings
Step 4. Use a chain cleaner as a quick option
If you don't want to clean the chain by hand, you can buy a 2-piece plastic chain cleaner. This device is fastened around the chain and has a reservoir for the degreaser and rotating brushes that clean the chain. To use it, follow the instructions included in the package.
Typically, you will need to wrap 2 pieces together around the chain, apply degreaser to the bottom half, and then roll the chain back for about 10 turns

Step 5. Reattach the chain if it slips out of place
Give the chain some slack by pushing the rear derailleur arm (the metal arm of the rear wheel) towards the handlebars. Put the chain back on the chainrings and push the rear derailleur arm into place. Pedal the chain a few times and you're good to go!
Part 3 of 3: Apply the lubricant

Step 1. Shake the lubricant container well
The various ingredients in the lube may have separated while it was stored on the shelf, so give it a good shake to mix it all together.

Step 2. Squeeze the bottle of lube and move the chain back as you apply it
Hold the bottle of lube with the nozzle resting on the inside of the chain. Use your free hand to move the pedals back so that the chain moves around the chainrings of the bike. Pass the chain around the chainrings several times, continuing to apply the lubricant to each part of the chain as it passes. Keep the lube bottle steady while moving the chain.

Step 3. Set the lube aside and continue moving the chain back
This will help the lubricant get into the chain. Run the chain around the plates at least 10 more times. Then, shift gears little by little to distribute the lubricant to the cassette gears and chainrings.

Step 4. Wipe off excess lubricant with a cloth
Place the rag against the chain and move the pedals back. Run the chain around the chainrings and through the rag a few times until all the excess lubricant has been removed.