There are 2 schools of philosophies:
1. Deontic logic
2. Consequential logic
1st means that it is innate in you e.g. you should not kill another fellow human being. 2nd means that you have to evaluate the consequence - if you do not like the consequence, do not do it.
Consider 2 scenarios:
Scenario 1. A trolley holding 4 people in high speed. To save the 4 people, you can flip a switch to change the track of the trolley but then, there is another man on the other track.
Scenario 2. A trolley holding 4 people in high speed. To save the 4 people, you can choose to push one man to break the speed of the trolley.
Which one should you choose? (you have to choose one)
If you subscribe to deontic logic, you will choose scenario 1. To another who believes in consequential logic, it does not matter.
The analysis will become more complicated if say, your loved one(s) is in the trolley or the man that you are pushing is your significant half.
According to the Economist's Golden Rule (always think of the benefit of the society), you should not let your emotions get the better of you. But who are we kidding?
There was a Nobel prize winner who used the amnesia theory - if you can forget who you are, your decision will always be for the greater good :P