If you lie, how will you teach your children not to lie? If you swear, how will you teach your children not to swear? If you are bad, how will you ask your kids not to be bad? You have to lead by example.
The most honest and effective way of teaching others is to exhibit your teachings through your actions. You must practise what you preach. Double standards: to practise one thing and preach another.