I used to do this all the time! Though usually the library was the place I ended up getting work done, procrastination happening at home... I'd get so anxious and panicky about what to do first that I'd freeze and end up playing games to distract myself, or reading fiction.
I definitely agree with the timer thing!!! Though I think maybe 10 to 15 minute chunks are better, 30 if you're trying to write a paper.
Also, write down things in order of highest urgency what needs to get done.
If you are studying for a test or just to cement the knowledge in your mind, you can break the time up too: Say 10 minutes flashcards, 15 minutes going through your notes, 5 min read an article, take break etc...
If you have to write something (which is always where I stalled), try handwriting whatever comes into your head about the topic. That will get the ideas flowing, and if you get a good chunk of writing down, you can come back to it after a short break and it may start to look like something useable.
Don't panic! If it's anxiety, drink some tea, calm your brain and avoid playing games or watching videos during breaks. Hope this helps