Salvation is due to the grace of God for by cooperation with that grace the tendency to choose sin (concupiscence) is overcome. One of the sources of right and wrong is conscience, however it must be properly formed. Sometimes a person is culpable even without knowledge because of indifference.
1777 … When he listens to his conscience, the prudent man can hear God speaking.
1781 Conscience enables one to assume responsibility for the acts performed. …
1790 A human being must always obey the certain judgment of his conscience. If he were deliberately to act against it, he would condemn himself. Yet it can happen that moral conscience remains in ignorance and makes erroneous judgments about acts to be performed or already committed.
1791 This ignorance can often be imputed to personal responsibility. This is the case when a man "takes little trouble to find out what is true and good, or when conscience is by degrees almost blinded through the habit of committing sin."59 In such cases, the person is culpable for the evil he commits.
Material and formal sin
This distinction is based upon the difference between the objective elements (object itself, circumstances) and the subjective (advertence to the sinfulness of the act). An action which, as a matter of fact, is contrary to the Divine law but is not known to be such by the agent constitutes a material sin; whereas formal sin is committed when the agent freely transgresses the law as shown him by his conscience, whether such law really exists or is only thought to exist by him who acts. Thus, a person who takes the property of another while believing it to be his own commits a material sin; but the sin would be formal if he took the property in the belief that it belonged to another, whether his belief were correct or not.
O’Neil, A.C. (1912). Sin. In The Catholic Encyclopedia. New York: Robert Appleton Company. http://www.newadvent.org/cathen/14004b.htm