First learn about the plant. Where did it originally grow? What family of herbs does it belong to? How is it used medicinally and magically?
Then learn the lore of the plant based on the cultures who were among the first to use it. This information can be helpful as it very often gives you details on what I call the personality of the plant.
Any spiritual tradition that holds power will include the concept of animism. This is an understanding that all things have their own spirit and some form of consciousness. This is extremely important to remember when working with herb and plant spirits. This animistic spirit is what you want to connect to when using the herb. When we harvest a plant, the plant is making a sacrifice to our purpose. It is giving us something it needs to sustain itself. This understanding of sacrifice exists in all old traditions. People are more inclined to help you if they receive gratitude for their effort. Plant spirits are no different.
Now, you need to get practical. Get your hands on some of the plant. Whether you harvest it or not, you need to thank it for its sacrifice. Depending on the toxicity of the plant, you should then connect with it via your 5 physical senses. Hold it in your hand. How does it feel on your skin? What color is it? How does it smell and taste? Does it make a particular sound when you rub it between your fingers?
Meditate on these qualities for a few minutes.
You can then connect with the plant spirit energetically by making a tea with it. You should have information on the plant to let you know if it is okay to consume it. Make this process a ritual. Brew your tea and as the plant steeps, give thanks. Ask it to tell you about itself. As you drink your tea, pay attention to the impressions and subtle sensations you receive. Your body is capable of the most powerful alchemy. It will make the herb a part of you and your knowledge of it will be complete.
Once you have done this, the plant spirit may have more to communicate with you, so be open to this.
This process should only need to be done once with each herb you choose because the spirit is in every individual plant.