The best way to do this is to set the capacity to equal the total number already booked. If you have waitlists turned off, the class will be displayed as "Fully Booked" on the front end. If you have waitlists on it will allow customers to join the waitlist.
For example, if you've sold 10 out of 15 available spots, change the capacity to 10. Or, if you've sold 0 spots, change the capacity to 0.
You can edit the capacity by going to Schedules in the Sawyer menu, clicking the pencil icon next to the name of the scheduled activity, and scrolling down to capacity. There you can update the count then save your change.
Once the capacity matches the number of students enrolled, the class will be sold out.
When a scheduled activity is sold out, it is displayed but customers cannot register.