Lock object while use G key

When I’m in object mode for example and I select left corners of a block and use G to expand it, the right corners move together with it. How can I lock the whole object that is not selected, so it will stick in his place?

Sounds like you have proportional editing enabled, as otherwise nothing other than the selection should be moving. Pressing O should toggle it on or off.