Trains are not cheap unless you take a gamble by booking in advance i.e. now. It is a long way, about 180 miles in all. For either train or bus, you must first travel into Bordeaux city and the Gare St Jean. You can do this by fram, €1,90 or by the airport bus at €8 or uber or taxi at €30 maybe.
Trains from Bordeaux will take you to the border at Hendaye, from where you can take a Spanish train to San Sebastian. Buses are direct.
The unknown is how long it will take you to extricate yourselves from immigration and customs at the airport. I I would allow at least two hours from arrival to train or bus time. By tram it takes around 45 minutes with trams every 10 minutes. The airport bus or taxi take around 30 minutes. The airport bus runs only about every half hour - go to https://30direct.com/en/ for times and on line ticket.
Find train times and tickets at http://www.sncf-connect.com and note there are two types of train. TGV must be reserved which is where the gamble comes in. Miss the train and your ticket is worthless.
You have a TER (regional) train at 1052 arrival at Hendaye 1321. There is no TGV until 1220, arrival 1447. If you miss a TER train you can use it on the next one a little over two hours later. If you have time on your hands, Bordeaux is a very big and very busy station with all the normal facilities.
At Hendaye you walk cross the station yard to the Euskotren station, buy a ticket (no sales on line) which costs about €3 and wait for their trains which run every half hour, every day. (PS San Sebastian is Donostia in the local Basque language. Panic not, they are one and the same place.)
Flixbus to San Sebastian have nothing I can see between 0905 and 1410. Takes around 4 hours, but very much cheaper than trains. They use a 'bus station' about 5 minutes walk from the Gare St Jean in a fairly grim area under a bridge, almost totally devoid of any facilities. The other operator I know of, BlaBla Bus, has nothing before 1520, from the same place.
I have recently spent a month in and around Bordeaux. Come back if you need any more information. I used trains and local buses extensively.