The 'yellow' loop is a way of processing fixed timesteps when frame times even though frame times are not actually this length of time.
For more information, this article could help. Be aware that how this works can be rather complicated or confusing at first.
For a more simple "blueprint" that is easier to understand, try:
// ...
sf::Clock clock
sf::Time frameTime{ sf::Time::Zero };
while (window.isOpen())
{
// ...
frameTime = clock.restart();
window.clear();
window.display();
}
// ...
You can see that there is only one line instead of that yellow loop and it basically stores how long it took since last time it was here (each time the clock is restarted, it returns how long it was running).
Then, you can simply multiply any motions or other values that change over time by that frame time - commonly by it in seconds:
position += velocity * frameTime.asSeconds();