Pre-sales (Private and Public) ERC20

I am developing a currency for my game, and I would like to know how pre-sales (public and private) works, what do I need to program in my smart contract?

Is there an example model for this type of situation? I'm researching and I'm not finding something that helps me understand smart contract programming.

Hi, I think maybe you can look at this documentation, hope it can give you some idea.
Crowdsales | OpenZeppelin Docs