How to calculate closing stock price

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