Once upon a time, there was an elderly lady who went to see Hazrat Muhammad (SM). She had a problem with her only son. She told the honorable and wise prophet that her young son kept asking for sweet treats all the time, and it was bothering her. She was a widow and had money troubles, so she couldn't keep buying him sweets whenever he wanted. She went to the prophet to get help with this issue.
The wise prophet (SM) listened carefully to her story. He felt really sorry for the poor woman and her situation. He told her that he wouldn't give her advice that day, but she should bring her son back to him after a week.
The woman trusted the wise prophet (SM) a lot. She left, thanking him deeply. A week later, she came back with her son. The kind prophet called the boy to him and said, "You're a good boy. You love your mom, and she loves you. So why not listen to her and not make her upset? Your mom doesn't have a lot of money, so she can't buy you sweets all the time. But when she can, she will get you some."
The boy felt better hearing these gentle words from the kind prophet (SM). He promised not to bother his mom for sweets all the time. He and his mom left the place.
After they left, one of the people around the prophet asked him, "Why didn't you give the boy this advice the first time?" The prophet (SM) smiled and said, "Well, I also really like sweets, just like the boy. So it's hard for me to give advice that I don't follow myself." Then everyone understood.
Moral: Don't tell others to do things that you can't do yourself.