If you wish to come by plane the nearest airport is Billund Airport, which is 45 km from Fanø. An airport shuttle leaves every hour from Billund to Esbjerg.
In order to catch the last ferry for Fanø, you should not arrive at Billund later than 8pm. Both Copenhagen and Hamburg Airports are 3 hours away from Fanø. If you wish to continue from the airport by train I recommend Copenhagen Airport, but if you wish to continue by renting a car, I recommend Hamburg airport. From Copenhagen please consider the bridge toll, by car.
From the bus/train station in Esbjerg to the Fanø Ferry: From the train/bus station in Esbjerg, you can continue to the Fanø Ferry by taking city bus nr. 5 or take a taxi. It takes 5-10 minutes.