Say you're writing a novel. Every writing session (but the first, obviously) should cover the end of the last scene and the beginning of a new one, AND THEN STOP, i.e. not finish the new scene.
Your brain will want to come back to the work to finish it, which overcomes the friction of "starting" something new every time.
It's easier said than done. It's surprisingly difficult to leave something unfinished at the end of each work session. But that's the trick.