friction always oppose the relative motion now that can be useful or sometimes loosing energy.
like when a block is sliding rightward on ground friction acts backward.
but when we walk we push our legs against ground in backward direction and then friction acts in forward direction because of which we move forward. so walking is not possible without friction.