Opening the book…
The work will always present itself as urgent, and it will always be lying about how urgent. The people closest to you learn very quickly whether you are actually available or only technically present, and once they decide you are not, they stop asking. That door is much harder to reopen than it was to close.
Turn the chair around when someone comes in. Put the laptop down rather than half-closing it. Answer the question about the dinosaur or the school thing properly, then go back to what you were doing. If you genuinely cannot stop, say when you can — and then actually do.
Real deadlines and genuine emergencies exist; say so plainly and give a time. If interruptions are constant and you never finish anything, the problem is the boundary, not the rule — set hours, but keep them honest and few.