It’s rough at first but you will learn the baby’s rhythms and preferences. If you track their sleep and wake up times (I did it the old fashioned way in a notebook) you’ll see a pattern emerge pretty quickly, and then it gets easier because you will figure out how to work with it.
Every baby is different so most of the advice you find won’t work, but if you try enough things you’ll eventually find something that works consistently. Or you might just luck out and get a good sleeper.