Please upload larger screenshot, and/or more than one screenshot, the one there is too small.
It might actually not be an infinite loop, it might just be a loop that takes a long time to complete. I suggest two things:
1. Use a smaller list filtered to around 50 or so elements to test the Apply to Each.
2. By default, Apply to Each runs one at a time and serially. This might take long time to complete. You can change Apply to Each to process more items at once and in parallel, like this:
2a. Click ellipses to the upper right of Apply to Each Action Block header, then from the menu options that appear, click "Settings"
2b. Under Concurrency Control notice the default "Off" - click the toggle switch to turn it "On":
2c. Drag the slider called "Degree of Parallelism" towards the left or right below, which can be dragged up to a maximum of 50 (to increase, drag it towards the right). If it is set at the maximum, then 50 items at once will be processed by the Apply to Each - instead of 1 item at a time with Concurrent Control off. When ready, click on the "Done" button.