Barnes went to Bethel High School in Bethel, Connecticut. In high school, he was named to the All-State team. He was also a member of the basketball team. Following his high school career, he was not chosen in the Major League Baseball draft. He then enrolled at the University of Connecticut, where he pursued a degree in political science.
The Boston Red Sox selected Barnes with the 19th overall selection in the 2011 MLB draft. During the 2012 season, Barnes appeared in five games for the Class AGreenville Drive and 20 games for the Class A-Advanced Salem Red Sox—all starts—posting an overall record of 7–5 with a 2.86 ERA and 133 strikeouts in innings pitched. He was selected to appear in the 2012 All-Star Futures Game. Entering 2013, Barnes was ranked 38th in the MLB.com Top 100 Prospects list. During the season he played for the Double-APortland Sea Dogs and Triple-APawtucket Red Sox. In a total of 25 games he had a 6–10 record with a 4.13 ERA and 142 strikeouts in innings pitched. Barnes spent most of the 2014 season with Triple-A Pawtucket, where he appeared in 23 games compiling an 8–9 record with a 3.95 ERA and 103 strikeouts in innings pitched. The Red Sox promoted Barnes to the major leagues for the first time on September 8. He made his MLB debut the next day, pitching three scoreless innings of relief in a 4–1 Boston loss to the Baltimore Orioles. He finished the rest of the season with Boston, making a total of five MLB appearances while giving up four runs in nine innings pitched. Barnes split time in 2015 between Pawtucket and Boston. In Triple-A, he compiled a 1–1 record with a 4.06 ERA in 17 games with 41 strikeouts in innings pitched. He made a total of 32 MLB appearances, pitching 43 innings while recording 39 strikeouts with a 5.44 ERA and a 3–4 record. Barnes spent all of the 2016 season with Boston, appearing in 62 games with 4.05 ERA and 71 strikeouts in innings pitched. Along with a 4–3 record, he had his first save, which came on August 9 when he recorded the final out of a 5–3 win over the New York Yankees by striking out Mark Teixeira. During the 2016 ALDS, Barnes made his postseason debut, pitching innings in Game 2 against the Cleveland Indians; he gave up three hits and one unearned run. Early in the 2017 season, Barnes was ejected for the first time in his MLB career, on April 23 by umpire Andy Fletcher, for apparently trying to hit Baltimore's Manny Machado with a pitch in response to a hard slide by Machado on Dustin Pedroia in a game two days prior. The next day, Barnes received a 4-game suspension for "intentionally throwing a pitch in the area of the head of Manny Machado." For the 2017 season, Barnes made 70 relief appearances with Boston, compiling a 7–3 record, plus one save, with a 3.88 ERA and 83 strikeouts in innings pitched. Barnes started the 2018 season in his usual role as a member of Boston's bullpen. During the regular season, he appeared in 62 games, compiling a 6–4 record with a 3.65 ERA and 96 strikeouts in innings. In the postseason, he made 10 appearances while allowing one earned run in innings as the Red Sox went on to win the World Series over the Los Angeles Dodgers. Barnes was included on Boston's Opening Day roster to start the 2019 season. He appeared in 70 games, recording a 5–4 record with four saves, a 3.78 ERA, and 110 strikeouts in innings.
Personal life
Barnes began holding an annual baseball clinic at the Newtown, Connecticut, Youth Academy for elementary school students in December 2013. Barnes was married in January 2019 to Chelsea Barnes.