Living life by a moral code (your Ethics), contributes to your health and happiness and therefore the quality of your life.
Happiness includes: Health, safety, freedom to produce and virtues for social harmony.
Happiness is considered an ultimate goal and actions that lead to happiness are considered morally good, while actions that lead to unhappiness or suffering are considered morally bad.
An example would be finding food to eat which would be considered morally good, but not finding food to eat would be considered morally bad, and in this case, death would be the end result.
When we live within a community, we also need to consider social harmony, so we must balance that pursuit of happiness by considering actions that are morally right as well.
An example would be sharing food with others which would be considered morally good, but not sharing would be considered morally bad, and in this case, compromised social harmony would be the end result.