Titus 3:5 says we were saved not because of our works done in righteousness.
But often it looks like God gives grace and people "earned it" like Cornelius in Acts 10
Acts 10:4 Cornelius stared at him in fear. “What is it, Lord?” he asked. The angel answered, “Your prayers and gifts to the poor have come up as a memorial offering before God.
I know Paul doesnt contradict so whats going on
In Acts 10:4, Cornelius's religious works has shown his desire to God from his heart in seeking God, and God the Father saw this to know that Cornelius would receive the gospel from Simon Peter which was why the angel sent to Cornelius bid Cornelius to send for Simon Peter to preach unto Cornelius the Good News so that he may hear, believe, and be saved.
This had to be done this way because this was the first time God would ask Peter to detour from his set goal & mission to preach the gospel first to the Jews by way of a vision to take time out to preach the gospel to the Gentiles.
It was not Cornelius works that would save him since he needed to hear the gospel to believe in Him to be saved, but his religious works of charity has shown to God the Father that it was time for him to hear the Good News in Christ Jesus.
God the Father sees everything, and He saw this Gentile sinner as one He would give to Jesus to save.
Matthew 11:[SUP]25 [/SUP]At that time Jesus answered and said, I thank thee, O Father, Lord of heaven and earth, because thou hast hid these things from the wise and prudent, and hast revealed them unto babes.[SUP] 26 [/SUP]Even so, Father: for so it seemed good in thy sight.[SUP] 27 [/SUP]All things are delivered unto me of my Father: and no man knoweth the Son, but the Father; neither knoweth any man the Father, save the Son, and he to whomsoever the Son will reveal him.
John 6:[SUP]44 [/SUP]No man can come to me, except the Father which hath sent me draw him: and I will raise him up at the last day.
John 6:[SUP]39 [/SUP]And this is the Father's will which hath sent me, that of all which he hath given me I should lose nothing, but should raise it up again at the last day.[SUP]40 [/SUP]And this is the will of him that sent me, that every one which seeth the Son, and believeth on him, may have everlasting life: and I will raise him up at the last day.
God knows whom will come to Jesus to believe in Him from those that prefer their evil deeds rather than come to the light to be reproved of them, and so Cornelius was such a person that God would send the Good News to as he was seeking Him.
Matthew 7:[SUP]6 [/SUP]Give not that which is holy unto the dogs, neither cast ye your pearls before swine, lest they trample them under their feet, and turn again and rend you.[SUP] 7 [/SUP]Ask, and it shall be given you; seek, and ye shall find; knock, and it shall be opened unto you:[SUP]8 [/SUP]For every one that asketh receiveth; and he that seeketh findeth; and to him that knocketh it shall be opened.
An example of God knowing whom would receive Him from those that would not can be found below in that reference.
Acts 16:[SUP]6 [/SUP]Now when they had gone throughout Phrygia and the region of Galatia, and were forbidden of the Holy Ghost to preach the word in Asia,[SUP] 7 [/SUP]After they were come to Mysia, they assayed to go into Bithynia: but the Spirit suffered them not.[SUP] 8 [/SUP]And they passing by Mysia came down to Troas.[SUP] 9 [/SUP]And a vision appeared to Paul in the night; There stood a man of Macedonia, and prayed him, saying, Come over into Macedonia, and help us.[SUP]10 [/SUP]And after he had seen the vision, immediately we endeavoured to go into Macedonia, assuredly gathering that the Lord had called us for to preach the gospel unto them.
So there is no contradiction here with Paul's wordings when Cornelius whom was seeking God personally, needed to hear the gospel too in order to believe in Him in a personal way by way of the Son to be saved.
John 14:[SUP]6 [/SUP]
Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me.[SUP] 7 [/SUP]
If ye had known me, ye should have known my Father also: and from henceforth ye know him, and have seen him.