We’re not all web developers (and fuschia may not be your favorite color), but Kevin’s idea can be adapted to many other situations where you’re working on something and get interrupted.
For example You’re editing a document. Insert a big red “EDITING STOPS HERE” headline when you have to put your work down. If this happens a lot, it might even make sense to build yourself a macro (in Word) or use a utility like TextExpander to create a hotkey that does this for you.
Or you get a phone call in the middle of cooking from a recipe. Write yourself a quick note about where you left off (or turn the container for the next ingredient upside-down, stick a Post-It on the recipe if you’re using an actual cookbook, or whatever). This will save you from salt-free bread, sugar-free scones, and flour-free brownies (all items that have come out of my kitchen. To be fair, it was my son who made the flour-free brownies).
Or you’re working on something with the assistance of an AI tool. Before you leave the chat, type a message saying something about what you plan to do next. It helps if you also instruct the AI not to splurf back with a lengthy reply telling you how awesome you are. (You’re awesome—there, I said it!)