I second James E's very clear directions. Note one important fact:
Using a transit pass in Budapest requires that you retain your ID -
passport. The transit cops will fine you for not having ID
The 24 hour and 72 hour Budapest-Travelcards (what they are called in English in Budapest) do not require identification. The 7 day and longer duration Travelcards do require identification and that identification number will be printed on the back of the card (really just a slip of paper about the size of a credit card). OH! But do be aware, Hungary like every other Eastern European country (last time I checked) does require visitors to have their passport at all times.
Unlike some cities, checking of transit passes in Budapest is routine.
On the subway, you can't get on without a check. On the trams and
trains, sometimes there is no check, but transit costs are low and
fines are high.
Ticket checks at the underground metro lines can be random. I've been there for days and not seen anyone checking. Other times they are there all day long & at the exits too. If you use individual tickets, hold your ticket until you get off and you are several hundred feet from the metro station. Same with the trams. There are plain clothes inspectors that will put on an arm band in the middle of a moving tram car and start checking; sometimes on the metro too. I was also once followed about 100 feet from the metro stop and checked. The fine is 8.000 forints on the spot.
While you can use the M1 for many things, using the M4 is a good way
to get from Pest to Buda, and takes to directly to the regional trains
to go to Szentendre and points north. To go to Godollo, use the M2 and
another local train.
The M1 runs the length for Andrassy ut and down to Vorosmarty ter near the river. Along Andrassy ut are the Opera, House, Operett Theater, House of Terror, Szechenyi Baths, Ice Rink/Lake (depending on time of year), Castle Vajdahunyad
, Hero's Square, City Park and the Zoo and some pretty spectacular residential and commercial architecture. Ride up, walk back.
The M4 is the newest line and it connects Keleti train station to Kelenfold train station (tourists rarely use Kelenfold and its of no great architectural significance). Unless you have a day to kill and want to see the "other side" of pest (the further end of District VIII), or you are staying near Kálvin tér and taking the train out of Keleti you will probably not ever need to use it. BUT, the new subway stations that it serves are pretty amazing modern architecture and worth ducking into if you like such things; check out the one at Kálvin tér.
The M2 does get used a bit more by tourists. It crosses the M1 and M3 at Deák Ferenc tér which is sort of Ground Zero for tourism in Pest. At one end is Keleti Station and in the other direction it stops at the Parliament and then at Batthyány tér where you can, as was pointed out, connect to the H5 Commuter Train to Szentendre. You can also take the 4/6 Tram around to the Margit híd stop and catch the Commuter Train at that point; and not be underground on the way there.
I guess that only leaves the M3 to describe. Naaa, really doesnt serve tourism well unless you are going to the West End Mall or the Nyugati Train Station. OH, but if you do go to the Nyugati station, do check out the underground. Its "amazing".
The metro is good, BUT, its a beautiful city and you dont want to spend it underground. The nice things about the M1 is its history (oldest on the continent of Europe) and the fact that it runs directly under Andrassy ut, so you can ride it up and walk back down the Champs-Élysées of Budapest on your return. Otherwise every place described (except Keleti Station) along the M2 and M4 can be accessed by Tram so you can see the beautiful city. How beautiful? https://www.youtube.com/watch?v=0nd9DuDGCz0