After arriving to the airport of Budapest, you need to go to the main train station – called Keleti Pályaudvar – where you can take a direct train to Sopron.
You can choose from two transfer options: either you can take a taxi at the airport or you can use the public transport. The first one is obviously quicker, but more expensive, while the public transport is cheaper, though it lasts over an hour. If you decide to take a bus/tram/subway in Budapest, you can search for routes and connections on this page:
[ BKK Futar ]
If you already know the exact date of your arrival, please visit the following website for trains from Budapest to Sopron:
[ Hungarian Railway ]
Not only will you find information about trains on the site, but also you can book your ticket there
[ How to buy e-train-tickets? ]