A huge variety of herbs are used in cooking, including basil, bay leaves, cilantro, chives, dill, marjoram, mint, oregano, parsley, rosemary, sage, tarragon, and thyme.
Most recipes will tell you when you should add the fresh herbs. Generally delicate herbs like basil, chives, cilantro, dill, parsley, and marjoram should be added to hot food at the end of the cooking process or as you serve. Hardier herbs like bay leaves, rosemary, oregano, tarrgon, and thyme can be added the last 20 minutes or so.1
Choose fresh herbs that are not discolored, damaged, or wilting. It is best to use fresh herbs as soon as possible, but you can store most herbs in your refrigerator by cutting off their stems and putting them in a small jar of water (like you would do with flowers) with a plastic bag or paper towel wrapped around the top. You might also have some success with an airtight plastic container.
If you really can't use your fresh herbs up in time, you could try drying or freezing them. The Kitchn recommends freezing hardy herbs like rosemary and thyme in olive oil, while Better Homes and Gardens suggests using freezer bags to freeze basil, chives, mint, and more.
Finally, dried herbs can be substituted for fresh herbs. Use about a third less because dried herbs are more potent than fresh.