OH! Okay, SO! Buckle up, it's time for a history lesson!
Cosplay is a term (coined in Japan, by the way) that basically smashes together the words "costume play", and it's kind of a performance art involving dressing up like a specific character. Obviously, the character doesn't necessarily have to be fictional. Some are interesting mash-up of genres. Like I literally once saw someone do a sci-fi version of Ruth Bader Ginsburg. But it all came into practice during a science fiction convention held in the 1930s though the cosplayers in question called it "futuristicostumes", and it was based on an existing artwork.
So, from there, you had people do this at other science fiction conventions and then it spread to Star Trek conventions then Rocky Horror Picture Show audiences and then comic book conventions. Now you have people who do it professionally, take professional photos, compete across a lot of conventions for prizes (which is what I did when I entered a Captain Marvel cosplay competition but nobody won because I wrecked the convention area with my powers.. BY ACCIDENT!)
tl;dr? It's a nerd's Halloween but expands well past Halloween.