I believe that the clearest teaching on this in Scripture is in Romans.
Rom 1:19 For what can be known about God is plain to them, because God has shown it to them. Rom 1:20 For his invisible attributes, namely, his eternal power and divine nature, have been clearly perceived, ever since the creation of the world, in the things that have been made. So they are without excuse.
Rom 1:21 For although they knew God...
Rom 1:32 Though they know God's decree that those who practice such things deserve to die...
Rom 2:12 For all who have sinned without the law will also perish without the law...
Rom 2:14 For when Gentiles, who do not have the law, by nature do what the law requires, they are a law to themselves, even though they do not have the law.
Rom 2:15 They show that the work of the law is written on their hearts, while their conscience also bears witness, and their conflicting thoughts accuse or even excuse them
Paul teaches us that to all people, no matter who they are, God has given, at the very least, two forms of revelation: His creation, through which His invisible attributes are made known; and His law which is written on our hearts. All people possess these. However, the rest of Rom 1 details how people have rejected them. And it is by them that those people will be judged.