In most situations, buying term life insurance is the better choice. Whole life insurance "invests" your money, but insurance is not an investment - it's simply insurance. You only earn, on average, 1-3% when you buy whole insurance. Whole life insurance also has a much higher monthly cost. Many financial advisors recommend that you purchase term insurance and invest the difference ways that will earn you a higher interest rate.
The video below is helpful for a better understanding.