There are component shops in most major cities that sell basic components for brew/scribe. You need components that are for the sphere of the spell you wish to brew, and for higher lvl spells you will need more components, and components of higher quality.
Low spells (circle 1/2) might only need 1 low comp, while spells from circle 5+ might need low, mid, and high (or higher) comps. The only way, aside from someone telling you, to figure out what needs what is trial and error, but you can easily find comps for low spells from the local shops.
Once you begin to train the skill up a bit you'll be able to see what sphere a comp is, and what quality it is, when you check the list in the shop. You can also type brew to see which comps you have on you and what they are as well.
Also, you can see what sphere a spell is by checking its help file (it'll be listed there), and what the spheres are of the spells you have currently memed by typing spell "sphere", such as spell healing to see all the spells with the healing sphere currently on your mem list.