The general rule is to put in aromatics first--stuff that contributes good smells. Traditionally that includes garlic, onions, dried spices, and celery. In oil,of course.
Then the hard to soft rule applies. The general idea is to have all of the food 'ready' at the same time, despite differences in cooking time. So you give the harder items, i.e. carrots, longer. More cooking time is required for items which have starches which need to be broken down (potatoes, carrots) or a fibrous structure that needs to be broken down (broccoli).
Proteins are a separate category and it depends on the amount of connective tissue (cubed beef, more time) or delicacy (lobster, less time). Either way, you don't want to overcook meats. Last, add ingredients that you really don't want to overcook, like fresh herbs, bean sprouts, lighter greens, lemon juice.