One of my favorite genres in fiction is main characters carving/engineering the future they want to see for society through conscious morally-uncomfortable action
Dune by Frank Herbert. Paul picking the slightest best possible way forward via the ability the spice provides – that of knowing everything that was and being aware of everything that is potentially to come, like if as seeing a tree of possibilities.
Kingdom, the manga by Yasuhisa Hara. King Sei ushering the end of the Warring States period in China, setting out to conquer all other warring states, taking it upon himself all the bloodshed to come. All so that an age of peace comes in China. While Sei isn't the main character, his role is key and all of Kingdom's plot follows a similar framework of strategical thinking + having the good of the people in mind. (Most beautiful is when other characters, such as important figures from enemy states, either resist him because they see it as an impossible task, not because they see his method as immoral, or they don't resist him as much... choosing to have faith in his vision).
The Chronicles of the Avatar series by F. C. Yee, especially the two Yangchen novels, where we see the avatar as a figure with huge political agency, in large part crafted by herself, being painstakingly aware of the losses needed for each and every choice she makes or plan she designs.
Attack on Titan by Isayama Hajime, to a degree. But I kind of see the ending and its conflict resolution as a cop out.