Your first cousin is the child of one of your parents' siblings. Your second cousin is the grandchild of one of your grandparents' siblings.
For someone to be classed as your thirty-first cousin, you'd only have to be related by blood 31 generations back (roughly 1,000 years). This could really apply to anyone at all. The stranger you sit next to on the bus is probably more closely related to you than that.