This is something many new parents struggle with, and I struggled with it myself. The best way to do this, in my opinion, is to not let infants sleep for too long, during the day naps in particular, and to not let an infant nap too close to bedtime. Often, new parents are quite grateful when their infants sleep, so they have a tendency to let them sleep as long as possible. That is fine during the night, but sometimes those very long naps are interfering with the sleep at night. Another trick I learned was to not let my infants fall asleep in the car, which they have a tendency to do, especially on the way home from somewhere in the evening. This seems to revive them, and they stay lively and can't sleep well after.