How can I change current index in For Loop?

I’m kinda new in such sort of programming, could you please show me an example (screenshot of function)?