If you have an event with a limited number of seats, you can go directly to Event website > Registration settings and click on "Set a maximum registrations limit".

Once this feature is activated, registrations will be blocked as soon as the number of confirmed participants has reached the set threshold.

You also have the option to specify a phrase that will be displayed once the quota is reached.

If your event is a paying event and you have a ticket office, you can follow this tutorial: Configuring your tickets to also limit the number of available seats per ticket.