The two types of truth, necessary and contingent, can be demonstrated by examining our knowledge of shapes.
Imagine a box on a table. Inside the box is an object which we cannot see. If we were asked to say what it was, or what shape it had, we could only reply that without seeing it, or otherwise examining it, we didn't know. This simple example amply demonstrate the value of empiricism.
But, if we were asked whether the object had a shape or not, we would answer in the affirmative. It is literally inconceivable that the an object could exist and not have a shape of some kind. And here our knowledge would spring not from empirical investigation, but from reason alone. We know that all objects have shapes before we look at them. Therefore, that truth is demonstrated by observation, but does not result from it.
We thus have two types of truth. One is gained empirically by observation and investigation, and we can call this contingent truth. We say contingent because what we have observed could have been otherwise, had causes and circumstances in the world been different. The other type of truth is a necessary truth because it is necessarily so, it could not conceivably be otherwise. Necessary truths are true throughout time, while empirical truths can be so at one time and not so at others.
It is important here not to mix up a necessary truth with a truth which is contingent, but almost inevitably true; e.g. Mr Smith is younger than 300. Though there are no known instances of people living for longer than three hundred years, it is conceivable that somebody might live that long. It is not a necessary truth.