As there are direct trains from Barcelona Airport to Sitges, you will have to first board the RENFE train R2 Nord from the airport to El Prat de Llobregat. From here, you can take a train to Sitges.