Take a look at this, easy to learn technique which might save you those completely lost endgames, in which you blundered that piece? Or got completely out played by your opponent...? but I'm afraid this technique can't save you if your flag drops...
One special way of producing stalemate is the so-called 'desperado' rook! As the below diagram.
Black now plays to activate a 'desperado rook' in doing so achieves stalemate in what was in theory a lost position. 1.Rd3? Rb8! 2.Kxc2 h2! 3.Rh3 h1=Q 4.Rxh1 Rb2+!= White cannot take the rook as this would achieve stalemate and so the rook checks the king endlessly offering itself up as a sacrifice. (Zherdev-Baranov Moscow 1950)
When there are only a few pieces left on the board and if your king and pawns are unable to move, then pay attention to stalemate combinations. Take a look at the below diagram, white to move in a lost position, but how could white set up his pawns and king to enable more drawing chances?
1.g3! Kxb6 2.Kg2 Kb5 3.Kh3! White is set up for the draw Kb4 4.Rxa2! This must have come as a surprise to Black. 4...Rxa2 stalemate.