A CEX works like an online broker: you open an account, pass KYC, deposit money and trade on its order book. It is the easiest way to buy crypto with fiat.
The trade-off is custody: the exchange holds your coins. If it is hacked, freezes withdrawals or goes bankrupt (FTX in 2022), you can lose them. Many people buy on a CEX and then move long-term holdings to their own wallet.