As the Catechism of the Catholic Church says, a sin is any thought, word, deed, or desire contrary to the law of God. A sin is a bad or evil human act as opposed to a good human act. A bad human act is contrary to the law of God whereas a good human act is in conformity to the law of God.
As the CCC teaches, there are three sources that determine the morality, the good or evil, of human acts. These are the object or the act itself, for example, almsgiving or murder; the circumstances and the intention. For a human act to be good, the object, circumstances, and intention must be good. For a human act to be bad or sinful, only one of these three sources need be bad. There are some human acts that are intrinsically evil in their object such as murder, robbery, fornication. These human acts are always bad regardless of the circumstances or intention. However, the circumstances or intention can lessen a person’s moral responsibility or culpability even to a point where such an act that is objectively evil is not imputed to the person at all, for example, under intense external pressure, force, or duress by some person, or invincible ignorance. However, the act in itself is still a bad act. A true human act is one that is done in freedom so someone who is externally forced to do a bad human act is less culpable of the act than a person who commits such a bad human act in freedom or without external force.