This word contains over a thousand years of drama. In brief:
Around the fifth century, the Goths were a tribe that helped defeat the Roman Empire; by the 1500s, gothic meant "barbaric" and was used to insult a new style of architecture; that architecture became associated with the medieval age; ideas of medieval darkness and mystery inspired gothic fiction of the 1800s like Dracula.
All this eventually led, in the 1990s, to goth fashion - characterized by vampire-ish black clothes and eyeliner, and a preference for dark music and moody Romanticism.