How to calculate closing stock price

How is the closing price of a stock calculated at day’s end?

The closing stock price is the last price at which a stock was traded during regular market hours. It is reported at the end of each trading day and is used as a reference for the next day’s trading. You can find closing prices on financial websites and trading platforms.