Following their win at leaders AC Milan in midweek, Juventus struggled to create many chances in the first half, but their cause was aided after Pedro Obiang was sent off for a dangerous tackle on Federico Chiesa just before half-time.
Juventus capitalised on the numerical advantage as Danilo was left in plenty of space to fire home a fierce opener in the 50th minute, but the lead lasted just eight minutes as Gregoire Defrel levelled to stun the hosts.
Ramsey, who has been in and out of the side this season, put Juve in front in the 82nd minute with his first goal of the season. In contrast, Serie A top scorer Ronaldo took his season's tally to 15 as he struck in stoppage-time to complete the win.
The result helped Juve close the gap with leaders Milan to seven points, having played one game less. Sassuolo stay seventh.
"Victories are built with everyone's work and sacrifice, we have already made mistakes too many times," Juventus coach Andrea Pirlo said.
"After Milan's win over Torino [on Saturday] we understood that we need maximum concentration and the desire to bring home the victories. We had to continue after the win at the San Siro. It was important to maintain our form."
After scoring three times in Milan in midweek, Juve's strikeforce could not get going in the first half at the Juventus Stadium.
Obiang's dismissal, however, gave Juve a boost, with the referee issuing a straight red card after the VAR asked the official to have another look at the midfielder's studs-up tackle on Chiesa.
Danilo's third Juventus goal settled the hosts' nerves, but Sassuolo, enjoying a fine season, were not overawed despite being a man down as Defrel fired them level and they had several other chances to take the lead.
Ramsey, who replaced the injured Weston McKennie in the first half, got the all-important second, arriving on cue to meet a Gianluca Frabotta cross, before Ronaldo drilled home to make sure of a third successive win for Juve.