The Fellowship of the Ring was formed as a brotherhood among members of the various Free Peoples of Middle-earth. Its purpose was to take the One Ring to Mordor that it might be cast into the fires of Mount Doom, the mountain in which it was forged, so that it would be destroyed and ultimately kill the Dark Lord Sauron.
The Fellowship was also known as the Company of the Ring, the Nine Walkers, or more simply the Company. Each of the members of the Company were representatives of their respective races, with Legolas and Gimli being the only Elf and Dwarf chosen.
Eventually total 9 people were chosen to take the ring to Mordor and destroy it.
Why 9? The number nine was chosen because dark lord Sauron had nine deadly servants who was bound to his will through the nine rings that was gifted to nine lords of men.
So it is kind of an offset or complimentary number.