The whole thought that Jesus closes with is that all of the previous things He has said are a foundation for life. Each aspect of teaching that has been brought out to the people if obeyed is a great foundation for life. In order to be a wise man (or woman) you simply obey the sayings of Jesus. Jesus compares heeding His words to a man who builds a house on a rock. Jesus says that no good contractor is going to build his house on sand, because the house will crumble in the first windstorm. The same is true in our life. If we have built our foundation on the things of earth, on our own laurels, on the temporal, then our house will crumble.
All of our lives should be on the Rock. We know that the Rock is Christ (I Peter 2:6). We need to have our foundation placed upon Him. When we trust Christ as Saviour, we move our house from the sand to the Rock.
Whenever I read this passage I think of a old popular hymn. In that hymn it speaks of our whole lives are secure in Christ. That Jesus is the Rock, and upon Him can we stand. It is only by the power of Jesus Christ that our houses can be built upon His foundation, the Rock. Our hope is indeed built on nothing less than His blood and righteousness. The chorus to that hymn was penned by Edward Mote and he wrote this:
" On Christ, the solid rock I stand;
All other ground is sinking sand,
All other ground is sinking sand."