God alone is good. The goodness of God is the basis for all morality. Everything created by God has goodness, but God alone is Goodness. Only God is perfect and infinite Goodness, by His very Nature.
The Nature of God determines whether a knowingly chosen act is either good or evil. All that is good is in some way like God, and all that is evil is in some way contrary to God. All moral acts in some way resemble the very Nature of God, and all immoral acts in some way oppose the very Nature of God. The eternal unchanging Goodness of God is what makes one act moral and another act immoral. Good acts can never become evil, and evil acts can never become good, because God is eternal unchanging Goodness itself.
Sin is nothing else but an immoral act. Actual sin is a knowingly chosen immoral act. Any knowingly chosen act, moral or immoral, is made by the free will based on knowledge within the intellect (the mind). All knowingly chosen acts are either morally good or morally bad.
A venial sin is an act that is not so gravely immoral before God as to be entirely incompatible with true love of God and neighbor. An actual venial sin does not include sufficient culpability to take away the state of grace from the soul, nor to deserve eternal damnation. A venial sin is always in some way contrary to true love of God and neighbor, but to a substantially limited extent. An actual venial sin always includes some culpability and some lack of cooperation with grace, and always deserves some degree of punishment.
A mortal sin is an act that is so gravely immoral before God as to be entirely incompatible with true love of God and neighbor. An actual mortal sin includes sufficient culpability to take away the state of grace from the soul, and to deserve eternal damnation.
The matter of an act is the objective morality of the act, apart from knowledge and choice. If an act was not freely chosen, or if an act was not chosen in the knowledge that the act is immoral, then there is no actual sin. But objectively, the act may still be immoral.
Human persons are able to sin because they have free will. An objective sin is any act that is, as a matter of fact, immoral. An actual sin is any act that is known (or believed) to be immoral and is freely chosen.
The above post was excerpted and adapted from my book: The Catechism of Catholic Ethics
Please take a look at this list of my books and booklets, and see if any topic interests you.