Saddle height, that's a good one.
I use the Lemond method for that:
https://www.gobeyondexercise.com/blog/2020/7/22/finding-the-correct-saddle-height-on-your-bike#:~:text=LeMond%20Method%3A%20Greg%20LeMond%20is,your%20inseam%20length%20by%200.883.
And a short with a good seat pad helps. It won't prevent the pain after a long ride, but it will surely be less.
Some riders also apply grease in the groin area for anti friction. Sweat, fabric, movement and skin isn't always a good combination 😉
You can buy special cream, but plain vaseline also works.
Thanks for the tip. When I bought my bike, the shop did do a bike fit, thus I believe it is set up correctly. So far, I don't experience any friction issues, which might happen when I do longer rides, thus I will keep the cream in mind.