"Preaching" is a kind of public speaking. It literally has a religious meaning. I will start by explaining that first.
A "preacher" is short for "a preacher of the gospel." It is an informal word for a person who speaks to a group of people to teach them Christianity, Jesus, and the Bible. "The gospel" is a key part of that teaching.
Traditionally, a preacher speaks loudly, intensely, and with great emotion about things he believes in deeply. This includes beliefs about how to live: for example, do good to other people even if they are not good to you; do not pile up riches on earth (money), but pile up riches in heaven (by acting well).
We want to see a preacher "practicing what he preaches." We want to see a preacher doing the things he says other people should be doing.
Informally, by extension, we use the same language about any strongly held system of rules of behavior. For example, perhaps someone talking about health stresses the importance of walking ten thousand steps every day. If he is unusually emotional about it, and says it is very important, you might say "he preaches the gospel of walking."
To say "we practice what we preach" or "we do what we preach" means "we actually do ourselves the things we tell others to do." If you met this person taking a brisk walk in the park, you might say "I see you're getting in your ten thousand steps per day," and he might say "Yes, I do what I preach."