Yes, a whole life policy uses a portion of your premium to build up savings that you can use during your lifetime. There will be terms in the policy about how much you can withdraw and at what intervals.
At any time, you can also cancel your whole life policy, and depending on how long your policy has been in place, there may be a “cash out” value, but it may be subject to cancellation penalties.
Note that if you cancel your whole life policy today to get the cash value, if you try to start it again tomorrow, the premium is not guaranteed, and in fact, you’re likely to pay much more the older you get.