Cornelius is a follower of God even though he is a Gentile (10:4, 22). God intercedes on his behalf by sending an angel and telling Cornelius to send for Peter. God wants Him to know Christ! In truth, this is as much for Peter as it is for Cornelius!
God prepares Peter by sending him a vision. The vision shows Peter that all food is clean (10:15). Jesus showed the same thing during His sojourn on the earth (Matthew 15:10-11). The dietary laws were given to Israel for a specific time and a specific purpose. They were never intended to be eternal. Peter now has a better understanding of that! But this lesson is preparing him for an even bigger one: that Gentiles need salvation too. Anyone can have a relationship with God, regardless of their heritage or race!