Since I was about 10 years old, I've asked myself that question in exactly those words to self-discover moral behavior.
Religion, ethics, and other systematic training and principles are also welcome. But if everyone just looked at that question and behaved accordingly, the world would be much better off.
Congratulations! You've discovered Kant's principle of universality.
I was a little Catholic girl, about age 9. On Easter Sunday, my brother and I were delivering newspapers. It was a HUGE route.
Someone gave us an Easter Basket with plenty of candy. I took one piece and realized that I had broken my midnight fast (to receive communion).
I decided that no harm would be done and received communion.
It was many years later that I found out that these were man made rules and while useful, were subject to change and circumstance. There is no required fasting at this time.