Usually when I'm writing I have youtube playing in the background, the noise just keeps me from getting bored as I write.
Just make sure you pick long videos that you've seen before so you don't get caught up scrolling your feed or watching the video instead!
Playing music would probably work too