A company, or better said, investors/shareholders, takes itself 'private' by buying the company's stock, generally on the open market, from the existing shareholders. This can occur when certain existing investors/shareholders in the company make a tender offer for all the outstanding shares of the entity with the purpose of taking the company private (i.e. no longer being a publicly traded company). The price to be paid to the existing owners/shareholders is usually a reasonably-based market price, plus a premium to entice them to sell their shares. The buyers generally wish to go private because they believe the intrinsic value of the company is higher than the prevailing market/share price; they see an inability of current management to achieve full potential, and they wish to capitalize on the perceived differential. The buyers also may want to go private to eliminate the costly regulations and expenses of maintaining the company as a publicly traded entity.
In such an event, if you were an existing shareholder and wished to tender your shares, you would be getting supposed fair value in return for giving up your share of ownership in the entity.