From the Summa,
Prima Secundae, Article 3, Question 76
So a person is bound to learn about his duties and responsibilties, but isn't required to know every single situation. A professional would know/ understand consequences of his acts, but a lay person would probably not have a clue. But St Thomas stresses that persons should study, just like St Pius X who asked that Catechism be taught on Sundays.
*****
https://www.newadvent.org/summa/2076.htm"...On the contrary, Whatever is a reason for sin to be forgiven, diminishes sin. Now such is ignorance, as is clear from 1 Timothy 1:13: "I obtained . . . mercy . . . because I did it ignorantly." Therefore ignorance diminishes or alleviates sin.
I answer that, Since every sin is voluntary, ignorance can diminish sin, in so far as it diminishes its voluntariness; and if it does not render it less voluntary, it nowise alleviates the sin. Now it is evident that the ignorance which excuses from sin altogether (through making it altogether involuntary) does not diminish a sin, but does away with it altogether. On the other hand, ignorance which is not the cause of the sin being committed, but is concomitant with it, neither diminishes nor increases the sin.
Therefore sin cannot be alleviated by any ignorance, but only by such as is a cause of the sin being committed, and yet does not excuse from the sin altogether. Now it happens sometimes that such like ignorance is directly and essentially voluntary,
as when a man is purposely ignorant that he may sin more freely, and ignorance of this kind seems rather to make the act more voluntary and more sinful, since it is through the will's intention to sin that he is willing to bear the hurt of ignorance, for the sake of freedom in sinning. Sometimes, however, the ignorance which is the cause of a sin being committed, is not directly voluntary, but indirectly or accidentally, as when a man is unwilling to work hard at his studies, the result being that he is ignorant, or as when a man willfully drinks too much wine, the result being that he becomes drunk and indiscreet, and this ignorance diminishes voluntariness and consequently alleviates the sin. For when a thing is not known to be a sin, the will cannot be said to consent to the sin directly, but only accidentally; wherefore, in that case there is less contempt, and therefore less sin.
..."