The Huns were a nomadic civilization in Eastern Europe. They’re mainly known for their King Atilla (“Atilla the Hun”). The area in which they roamed and ruled very closely corresponds to the area of modern-day Hungary.
The Huns were active in 300-400 AD. The country of Hungary was declared in about 900 AD.
According to Wikipedia, the correct demonym for Hungary is “Hungarian.” However, the etymology of Hungary likely comes from the Huns who were located in the same area:
Hungary, the name in English for the European country, is an exonym derived from the Medieval Latin Hungaria. The Latin name itself derives from the ethnonyms (H)ungarī, Ungrī, and Ugrī for the steppe people that conquered the land today known as Hungary in the 9th and 10th centuries.
(The date discrepancy is odd – the original Huns were long gone by the 9th and 10th century.)
The usage of Hun as a demonym is confused by its pejorative usage as a violent, barbarous group of people (stemming from its association with Atilla). For example, it was often used in the 20th century to refer to German people:
Beginning in World War I [Hun] became an often used pejorative seen on war posters by Western Allied powers and the basis for a criminal characterization of the Germans as barbarians with no respect for civilization and humanitarian values having unjust reactions.