To attend screenings at the Cannes Film Festival, you must either be an accredited attendee or hold an official invitation. Aside from screenings at the Cinéma de la Plage (beach cinema) which are open on a first come, first served basis, and a limited number of tickets for the Director's Fortnight, there is no access to festival screenings in the main venues for members of the general public.
If you are an accredited attendee, tickets are only required for films showing "In" or "Out" of Competition. In the last few years, ticketing has moved from the "get there early and wait" model to an online service. To obtain tickets you now need a unique ticketing code (supplied when you collect your accreditation pack) and your badge. With these, you need to log on to the festival's ticketing web site.
At the beginning of the festival, you're asked to login and select the days you'll be in Cannes. You're then presented with the screening schedule for those days and you can pick the films you would like a ticket for. Sadly, this doesn't guarantee you a ticket, rather it puts you into an opaque system in which some people get allocated tickets and others don't.
Either way, around 24 hours before the scheduled screening time, you are notified via the same website (so you need to login to check) whether your request was successful or not. For those who are successful, tickets must then be collected from the Billetterie Centrale (Central Ticket Office), located in the Hall Méditeranée in the Palais des Festivals at least 4 hours before the screening.
Tickets are not required for films screening in the various sidebars of the festival: Un Certain Regard, The Directors' Fortnight, or International Critics' Week. To attend screenings in these sidebars, you simply line up outside the venue at least one hour before the scheduled start time. An appropriate accreditation badge or invite is required to gain entry.
Films showing in the Marché du Film (Market) are generally only open to holders of Market or Press accreditation.