From Porto Airport (OPO) to Aveiro
The best option is by long-distance coach. Both Flixbus (https://www.flixbus.pt/) and Rede Expressos (https://rede-expressos.pt/en) offer regular, direct connections (look for "Porto (Aeroporto)" and "Aveiro" as the two stops), with a travel time of about 60-80 minutes each way. Expect to pay € 5 - € 10 depending on the time of day and how far in advance you book.
Alternatively, if you wish to make the trip by public transport (which in general will not be cheaper than the coaches, and may take longer), take the metro, direction Estádio do Dragão (Line E), to Porto Campanhã, which is the principal train station. From there, there are different types of trains to Aveiro, cheap local trains (Suburbanos, fare around € 3.95 ), which depart every hour and need one hour to reach Aveiro, and more expensive fast trains (Intercidades (IC) or Alfa Pendular (AP), fare up to € 17. For more details see https://cp.pt/en.
From Lisbon Airport (LIS) to Aveiro
If you arrive at Lisbon Airport the fastest way to get to Aveiro is a train from the station Lisboa Oriente. To reach Oriente from the airport you can take the metro (red line, direction São Sebastião) or a taxi/Uber. The fastest (and recommended) trains are the Intercidades (IC) and Alfa Pendular (AP) services with full-price fares of up to € 31 . Departures are roughly hourly, the scheduled travel time to Aveiro is about 2 hours by AP and 2 and a half hours by IC journey to Aveiro. Due to the excellent train connections to Aveiro you can avoid long waiting times at Lisbon. For more details see https://cp.pt/en.
Alternatively, both Flixbus and Rede Expressos offer connections, generally cheaper but slower than the train, from Lisbon Oriente (there are also a few direct connections from Lisbon Airport). Expect travel times of 3 to 3 and a half hours by coach from Lisbon, fares start at about € 5 if booked in advance but can reach € 20 at busy times.