The main language of Libya is Arabic, which is spoken across the country with some variations in the dialect. The western part of the country speaks a dialect more similar to that of Tunisia and the other North African Arab countries, such as Algeria. In the eastern part of Libya where you can find the city of Benghazi, they speak a dialect that is more similar to Egyptian Arabic.
If you have learnt Modern Standard Arabic (MSA) then you may encounter some difficulty trying to understand Libyan Arabic. As is the case with many different Arabic dialects, the further away from the Middle East you get, the more unintelligible the dialect becomes - looking at you Morocco. If you have learnt Arabic in Lebanon, Syria, Iraq, Egypt or Saudi, chances are people in Libya will understand what you are saying, but you will definitely struggle to keep up with the North African accent and dialect.
Most Arabic dialects have a unique way to say "hey, how's it going?". The Libyan version of this is: 'shin al Jow' (شنو الجو).
Libya also has a sizeable Berber population that speak local Berber languages. Sometimes these are referred to as Amazigh or Tamazight. Berber languages are indigenous to North Africa and are spoken by millions in the region. Most of the speakers today can be found in Morocco and Algeria, with some also spread throughout Libya, Tunisia, Mali, Niger and Mauritania.
Berber languages share many borrowed words from Arabic, however the languages are not mutually intelligible. But to the untrained ear who understands a few things in Arabic, they might sound similar. There are currently an estimated 300,000 Berber speakers in Libya still today. Berber languages are currently going through a revival in North Africa, namely in Algeria and Morocco where they have been official languages and are now being taught in schools. Libya during Gaddfi's time suppressed the Berber languages and even outlawed the Berber flag, so when you visit Libya you definitely won't see as much Berber writing, if any.