A commitment device is something that forces you to follow through with a plan, even if you may be tempted to abandon the plan later on. A classical example is a general making his army cross a bridge and then burning the bridge. With the bridge burned, the soldiers can no longer retreat and they are now committed to fighting till the end.
But commitment devices also work at a personal level. There are things you can do to force yourself to act in a certain way that you know aligns with your long-term interests rather than your short-term interests. For example, if you have a cell phone addiction, you can put your phone in a safe that has a timed lock that won't open until a couple of hours have passed.
But there are also apps out there that function as a commitment device. The one I am using is called Beeminder.