After a relatively quiet international break for Ronaldo, with one goal in three games for Portugal, he scored in the 38th minute in Turin, finding the net for the fifth successive league match.
Four minutes later the 35-year-old forward brilliantly struck at the far post to double his side's advantage, taking him to eight league goals for the season, from just four starts.
Ronaldo turned provider on two occasions as Juventus looked to score again but poor finishing meant the hosts failed to add to their tally.
"When you come back from the international break it is always difficult, but we returned with the right spirit from the first minute," Pirlo said.
"We dominated the game well, we needed a game like this."
Having won four of their previous five games in all competitions, Cagliari showed plenty of confidence in the early stages, with Juventus looking a shaky having won just three of their last seven before the international break.
However, after recovering from COVID-19, then an ankle injury, before travelling to play for his country, Ronaldo looked sharper than all around him as he took charge.
The finish for his first goal was a trademark one, cutting inside twice before driving a low shot into the net, but the second was even better, adjusting as the ball was diverted behind him before flicking it home.