In order to raise a child to be honest,
parents have to stop setting them up to lie. They have to either stop overreacting and immediately punishing their child for doing something wrong after the child's admitted their mistakes.
Or, parents have to stop asking questions that they already know the answer to.
When a child admits to his wrongdoing, keep calm and react appropriately. If the situation calls for him not watching television for the rest of the day, then go ahead and dole it out.
But not without talking to your child about his misdeed and more importantly, not without thanking him for his honesty.
On the other hand, if you've asked your child to clean his room and know he didn't, don't ask, "Did you clean your room yet?" In an effort to avoid getting into trouble for not doing so, your child may resort to lying that he did.
Instead, go straight to the point and say that you know that he hasn't cleaned his room and repeat your instructions.
Last but not the least, be a model of truth. Children mimic the behaviour and words of mum and dad. So if they see their parents dropping white lies here and there, they may come to deem it as appropriate behaviour.
It is easy to tell children what to do, but the most effective way to teach them something is to show them how to do it. So as much as possible, be honest in everything you say and do.