A species is the most basic unit of classification for all organisms that live, or have ever lived, on Earth.
The way we sort organisms is important, because it determines how we see and account for patterns of life. However, defining the term "species" in a way that works for all organisms is surprisingly difficult.
Historically, species were defined based only on their appearance, or "morphology," a process known as the Morphological Species Concept. However, this system is often inadequate because natural selection can cause unrelated organisms to be quite similar in appearance. An example of this can be seen in reptiles like snakes and legless lizards. The opposite can also happen, when very different-looking organisms are members of the same species.
The most common definition is the Biological Species Concept, which defines a species as a group of organisms that can interbreed and produce fertile offspring.
The Biological Species Concept too has limitations. Organisms that reproduce alone, such as bacteria or dandelions, don't always interbreed to reproduce. Also, it's hard to classify extinct organisms, whose reproductive partners are unknown.
A more comprehensive definition is the Evolutionary Species Concept, which defines a species as members of a common branch on the tree of life, which share the same evolutionary history. This definition uses genetics, behavior, and geography in addition to reproduction and morphology to sort organisms.
As every population of organisms is constantly evolving, the lines dividing genetically related groups may be very broad, or very thin and blurry. Scientists looking for a single definition that works for all organisms, alive and extinct, sexual and asexual, are likely to continue debating the best way to define a species.