You cannot cross directly into Famagusta from the government-controlled areas of Cyprus. Instead, you must cross the Green Line into the Turkish-occupied territory (known as the de-facto Turkish Republic of Northern Cyprus). The nearest place to do this is from the Strovilia crossing near Agios Nikolaos, which is located inside the British sovereign military base area.
In general, you will need to travel by car. Famagusta has no functional public transportation, and there are no regularly scheduled public transportation links across the Green Line (although private tour operators do operate across the Green Line during peak tourist periods).