One possibility could be Luffy changing key events to prevent the losses of his dear friends. This would add a lot of drama and emotional depth to the story.
One possibility could be that Luffy goes back in time and decides to prevent the death of Ace. He might use his knowledge of future events to stop the Marines from getting to Ace in the first place. This would change the entire course of the story, as Ace's death was a major turning point for Luffy and the Straw Hat crew.
Luffy could change the past in several ways. Firstly, he could use his devil fruit powers in a more strategic way. Since he has the experience of future battles, he knows his opponents' weaknesses better. So, when facing the enemies who were involved in Ace's capture, he can defeat them more easily. Secondly, he could try to influence Ace's relationships. Maybe he can make Ace form stronger alliances with other pirate crews, which would make it more difficult for the Navy to target him. Also, Luffy could try to expose the Navy's secret plans earlier, which would change the power dynamics in the One Piece world and ultimately save Ace.
Well, he could go back to the time when his crew first formed. Luffy might use his knowledge of the future to make their early adventures easier, like knowing exactly where the treasure is on certain islands. Or he could travel back to the time of the great pirate wars and try to stop some of the bloodshed. This would change the power dynamics in the world and create a whole new set of challenges and allies for him.
If Kylo Ren went back in time in fanfiction, he might try to change the events that led to his fall to the dark side. Maybe he would go back to a time when he was still Ben Solo and prevent himself from being influenced by Snoke. He could use his knowledge of the future to avoid the mistakes he made.
Well, if Robb Stark went back in time, he might be able to prevent his own mistakes and change the course of history. Maybe he could save his family and allies from the tragedies that befell them.
It could be a time - traveling pirate who has his own evil plans for the past. He might be trying to change the past to gain ultimate power in the future. So he becomes an obstacle for Luffy who wants to either preserve the past or make positive changes.