Start with a well-indexed PostgreSQL database, stateless application servers and background jobs for slow work; that alone carries you to tens of thousands of users. Scaling problems worth having show up in metrics first, and you fix the measured bottleneck, not the imagined one.
Have a question specific to your product?
Share the context and I will reply with a practical next step.