I'd also say to recognize when you are in a bad situation and leave. I was in a good first job until we got new management and flipped everything upside down. I took a paycut but I'm way happier at my new job. It's given me different but new opportunities but it was a lateral move.