As an expectant first time parent, this is the bit that I'm bracing for most.
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.
Relax: it only lasts a few months. Rarely more than 60 or 70.
The big tip I have for you is to understand wake windows. Babies can get too tired to sleep(!) so you need to make sure to put them to sleep roughly 1-1.5 hours after they last wake up.
Highly recommend getting a sleep tracker app.
Follow a routine every day. I posted elsewhere in this thread what worked for us. It was tough when they were infants because neither of ours slept through night till about 2. The routine saved us.