96 chevy blazer lt

I have a 96 Blazer LT. For some reason when im in gear idling the engines starts to sputter and then stalls. It also happens after changin gears. When sitting at stiop lights if i put it in neutral and rev the engine it wont stall out. it seems to stall out quicker when im applying the brakes. any ideas?