From https://www.tripsavvy.com/tv-show-tickets-in-los-angeles-1587005
All TV show tickets are free. Having a ticket in hand does not always guarantee a seat at the show, with some exceptions...
This is usually the case, even with series finales. However, keep in mind that for these episodes - the studio/producers usually retain some privilege for inviting special guests.
This includes the full gamut from game shows, reality/competition shows, daytime talk, late night talk, and scripted shows.
Keep in mind however, that there can quite often be a substantial waiting list for access to a particular show.
Obviously, the producers do not want any camera shots of the audience chairs being empty - so in the case of Saturday Night Live (NBC, US) (which is highly popular) - there is a lottery. This is used in conjunction with a standby system, which covers the case when a ticket lottery winner does not show up to the show. See https://freetoursbyfoot.com/saturday-night-live-tickets/
There are even cases when a studio audience cannot be filled. In this case, a service like Seatfillers may be used, or the producers may leave rows of seats that are located in less desirable parts of the studio empty (you will sometimes see this on CBS's The Price is Right, as seats behind the announcer are sometimes left empty).