I let the manager set lineups to start the season. Then, once I'm a few weeks into the season and each player has a decent amount of plate appearances, I start using splits to determine which spots to place each batter.
If you go to a player's profile, click Batting Stats, then [current year] Batting Splits, and at the very bottom, you'll see how each batter is hitting in each spot in the lineup they've logged PA's at.
For example, Ronald Acuna is a permanent fixture as the leadoff hitter for Atlanta IRL but his production as the leadoff hitter in OOTP doesn't always translate as it does IRL. So if he's struggling at leadoff w/ a wRC+ well below 100, I'll move him to a different spot for another few weeks. I'll keep doing this until I find a spot in the lineup where he starts mashing and keep him there until his wRC+ starts to dip (if it ever does).
You can also use the double splits drop-down in the same screen to view how each batter is producing in each lineup spot vs left and right-handed pitching.
My only rule of thumb is I won't put my best players too low in the lineup. I'll never drop a player like Acuna to 7-8-9... but if he's logged PAs at 1-2-3-4-5-6 and he's destroying baseball in the 6th spot compared to the other spots, I won't hesitate to keep him at 6 until his production proves otherwise.
Another method you can use is this
Lineup Analysis tool. I used this for a while and found it translates surprisingly well to OOTP. Just insert names and plug in each player's in-game OBP and Slugging stats, then click submit. The tool will generate optimum lineups based on those stats.
Of course, it's not at all perfect b/c it isn't a tool that is built for OOTP's sim engine. It's also very time-consuming plugging in OBP and SLG for each player multiple times throughout the season which is why I stopped using it. But it's a good starting point.
Here's another link to a good description of using sabermetric lineups:
Batting Order Sabermetrics
Overall, though, the best way to optimize each player's production -- batters and pitchers -- is to learn how to effectively use in-game splits above all else.