If you're identifying a totally unfamiliar plant in the field, then typically you consult a field guide or botany textbook that has a key.
- These books can be broad or specific. For instance, I have one that's a pocket guide to conifers, and another that's a guide to Sierra wildflowers. They can also be designed for a technical audience or for laypeople.
As an example, I have a bunch of these growing around my house:
[Source of photo: Agave attenuata, Wikipedia , CC-BY-SA license.]
Without consulting a book, I can pretty quickly tell that it's a flowering plant, and it's what's known as a monocot, meaning plants like grasses and onions that have parallel-veined leaves. I have a book called Plant Classification, by Lyman Benson, and in ch. XI it has a key to the monocots.
Item 1 in the key is basically whether it's an aquatic plant (plus a bunch of other criteria). My plant isn't, so I skip down to where the text sends me for plants that don't have this trait.
Item 2 is technical stuff about the flowers: "Pistils commonly 10 to numerous, rarely 6-9, separate, each formed from a single carpel; stamens usually 7-many or rarely 6 in pairs, i.e., 2 opposite each petal." This is pretty common for flowering plants -- the classification system is all about the flowers. If the plant isn't in bloom, or you don't have access to a flower, you're often out of luck.
So at this point I go out in my back yard, where I do currently happen to have a plant with one of the big, spectacular flowers stalks like in the WP picture. Unfortunately this one has gone to seed, and all I have left are the dried , hardened sepals. The pistils are gone, dried up and blown away, so I can't apply the criterion in the book.
So at this point I cheat because I know it's an agave, and I look in the index of the book and find that it's part of the lily family, reorganized these days to be part of the Asparagaceae.
So I think you can see from this example that in most cases, if you're a layperson like me, it's going to be very hard to key out a plant from a general, technical book. Your best bet is to find a very specific, localized field guide, like Guide to the Native Cacti of San Diego County, and one that has a key designed to be used by laypeople.
In your situation, your best bet is probably to wait until next year when these plants are in flower (they look like they've fruited in your photos), and take home a leaf and flower sample. It's kind of hard to tell from your photo, but it looks to me like your plant's most distinctive feature is that it has a magenta stem and a magenta raceme with dark black berries. You might be able to google on terms like that and come up with something. As search terms, you could also include the geographical area and stuff about leaf structure (pinnate?).