The seven-time Grand Slam champion found herself 2-0 down in the opening set, but immediately broke back, before taking a 3-2 lead.
Cornet had a chance of her own to break again, but Williams's serve proved too powerful and she held for 4-2.
The young French woman was holding her own, passing Williams at the net, before forcing several mistakes out of her more experienced opponent.
Williams showed her experience though, upping her game at a crucial point, and broke Cornet in the ninth game to win the first set.
The American had to work hard to win her serve at the beginning of the second set, with Cornet showing her ability to match Williams in the longer rallies.
Cornet did get her break soon after, making it 3-2, but just as in the first set, Williams immediately restored parity before edging ahead.
She then increased the intensity again to break Cornet, before powering through her final service game and into the third round where she will face Maria Sharapova.