What is a learned emotion that may help someone from doing something they know is wrong is it anger, jealousy, guilt, or grief?

Guilt is a learned emotion that may help someone from doing something they know is wrong. Feeling guilty about a past action can act as a deterrent and prevent someone from repeating the same mistake in the future.