I need advice ftm

My baby woke up at 2am for a feed and was so fussy/didn’t go to sleep until 4am 😓. It was so frustrating and I was trying my hardest not to fall asleep. How can I prevent this