Well this depends on the workout. Cardio you want to make sure about 2 hours before you workout that you get in some protien/complex carbs. This way you have enough fuel to charge your workout.
Pre-post lifting is a little different. In short Pre-lifting get in some protein and complex carbs. Post lifting get in protein and simple carbs. The simple carbs will replenish glycogen stores and the protein will help repair muscle.