This is not much of a concern for those who still have their chain covers. Chain covers keep away most of the dirt and prolongs the life of your drive chain.
But if you have exposed your chain to elements, then you have to take more care. Ideally, the chain should not contain any dirt or grime. So, if you have an exposed chain - sprocket set, then it is advisable to keep it clean.
First, ride the bike couple of meters (around 300-500 mtr is enough) to warm up the chain. Then put the bike on the center stand. Now take a metal brush or a old tooth brush and clean the chain. Brush off all the dirt and grease. (For those who want to go a step further, you can unlock, remove your chain and clean it). Now wash the chain with a rag soaked in detergent or kerosene. Clean and dry the chain as much as you can. Drive around to fling off the detergent / kerosene and put the bike on main stand again. Clean the chain again with dry rag - clean and dry it as much as you can.
Then apply grease to the inside of the chain links carefully. Make sure you don’t leave it all over so that it won’t smear or keep flinging off while you ride.
If you want to take out the chain and clean, go ahead. Unlock the chain, take it, clean it with brush and kerosene/detergent and then dry it. Then put the chain in a old pan (coil it and put it) and put it on a hot plate. When it gets hot, add grease in small quantities. Do it till the molten grease cover the chain. Don’t put all the grease together or boil the grease and put the chain. It may cause air entrapment under rollers and the effect of lubrication will be wasted.
Why should you use grease? Why cant you use Oil? Simple - oil is less viscous, so it will fall off the chain soon - it won’t stay inside and provide lubrication. The lube is supposed to sit inside the chain and protect it from water and dirt - Oil attracts more dirt than grease. Grease, on the other hand, stays inside the chain, keeps it lubricated, repels water and collects less dirt.
If you are more finicky then you can use specially formulated chain lubes – like Honda HP Chain Lube, Motul chain cleaner or any of the other makes.