Is it permissible to do evil when we think that good may be the result?
To the eyes of faith no evil is graver than sin and nothing has worse
consequences for sinners themselves, for the Church, and for the whole
world. [CCC §1488]
But the fact that we may sin does not mean that we are without hope.
To return to communion with God after having lost it through sin is a
process born of the grace of God who is rich in mercy and solicitous for
the salvation of men. [ibid., §1489]