Genesis 38:9 And Onan knew that the seed should not be his; and it came to pass, when he went in unto his brother’s wife, that he spilled it on the ground, lest that he should give seed to his brother.
Onan was to raise up a seed for his brother. He was to fulfill the culture an the law of his day. Instead of doing that he sought ways to take care of himself and not to harm his own personal inheritance.
That is the typical way we live. What is in it for me. How will this affect me? The real question should be what does God want me to do regardless of how much it will cost.
What decisions are you confronted with that might cost you more than you are willing to pay? What choices do you make on a purely selfish motive? Maybe God would speak to you about serving others and less of yourself.