Line 9 and 10 are a bit confusing for me does line 9 show events which can be of any type such as closing the window if that's correct than why we write SDL_PollEvent
When an event happens (window is closed, key is pressed, mouse is moved, etc.) the event will be added to something called the event queue.
Line 9 creates a SDL_Event variable named event. It has not been initialized (assigned to) yet so it's useless at this point.
On line 10 event is passed to the SDL_PollEvent function. SDL_PollEvent will look in the event queue and if it's empty it will simply return 0 (which will be treated as false by the while loop, making it stop). Otherwise it will copy the first event in the event queue to the SDL_Event object that you passed to the function (The event variable on line 9), remove it from the event queue and return 1 (which will be treated as true by the while loop).