Peter was yet a sinner when He walked on the water; he hadn’t gotten “Cocky”. And Christ still allowed him to both witness and experience “Him”.
To know Christ.
Jesus knew that Peter was frightened of the winds and the waves, but the elements were clueless and none the wiser.
Our Lord cared only about how Peter trusted in Him.
God’s aware of past, present and future happenings; no matter how cocky we may become.
He’s concerned about how we trust in Him because we know that He already knows, and for Him to know, means that He’s already been there and waiting for us to show up – Thus showing Himself as God with many infallible truths, to each one of us.