Hernández signed with the Houston Astros as an international free agent on May 31, 2012.[2] He made his professional debut with the Dominican Summer League Astros.[3] He spent the 2013 season with the DSL Astros as well, logging a 5–1 record and 1.26 ERA in 13 appearances.[3] In 2014, he split the season between the Gulf Coast League (GCL) Astros and the rookie ball Greeneville Astros, accumulating a 5–1 record and 2.17 ERA in 12 games.[3] He split the 2015 season between the Low-A Tri-City ValleyCats and the Single-A Quad Cities River Bandits, posting a 3–4 record and 3.12 ERA with 76 strikeouts in 66+1⁄3 innings of work.[3] In 2016, Hernández split the year between the High-A Lancaster JetHawks and Quad Cities, recording a 6–8 record and 4.51 ERA with 107 strikeouts in 107+2⁄3 innings pitched.[3] He split the 2017 season between the High-A Buies Creek Astros and the GCL Astros, pitching to a 5–5 record and 3.68 ERA in 18 appearances between the two teams.[2][4] Following the completion of the minor league season, he played for the Águilas del Zulia of the Venezuelan Professional Baseball League.[3]
Miami Marlins
On December 14, 2017, Hernández was selected by the Miami Marlins in the 2017 Rule 5 draft.[5] He began the 2018 season on the disabled list with a tooth infection[6] and made five rehab appearances[3] Hernández made his major league debut by pitching two scoreless innings against the Atlanta Braves on May 10.[7] He recorded his first major league strikeout in his next game, on May 13 against Ozzie Albies of the Braves.[8] He picked up his first major league win on July 11 against the Milwaukee Brewers[7] and finished his rookie season going 2–7 with a 5.21 ERA in 65+2⁄3 major league innings.[2] Hernández split the 2019 season between Miami and the Triple-A New Orleans Baby Cakes, recording a 3–5 record and 5.03 ERA in 21 games for the Marlins[2] and was 3–1 with a 1.13 ERA in nine games for the Baby Cakes.[3]
In 2020, Hernández earned the fifth starter spot in the Marlins rotation at the start of the pandemic shortened season[9] and pitched in six contests, registering a 3.16 ERA with 34 strikeouts in 25+2⁄3 innings pitched[10] He suffered a lat injury on September 1 and spent the rest of the season on the injured list.[11]
Hernández began the 2021 season in the rotation before suffering a biceps injury.[12] He was reinstated from the injured list on June 3[13] only to suffer a “severe” right quad strain in his first game back, returning him to the injured list.[14] Hernández was again activated on August 15 and pitched 51⁄3 innings of one-run ball, earning a no-decision.[15] For the season, he made 11 starts with a 1–3 record and 4.18 ERA.[16] In the 2022 season, he appeared in 20 games (10 starts) and was 3–6 with a 6.35 ERA[16] and he was designated for assignment on November 15, 2022, and removed from the roster.[17]
New York Mets
On November 18, 2022, the Marlins traded Hernández and Jeff Brigham to the New York Mets for Franklin Sanchez and a player to be named later (Jake Mangum) or cash considerations.[18][19] He was initially optioned to the Triple-A Syracuse Mets in 2023, but suffered a right shoulder strain and was placed on the injured list to begin the year.[20] On July 3, Hernández was activated from the injured list and optioned to Triple–A.[21] On July 24, he was recalled to the active roster.[22] However, he did not appear for the Mets before he was placed on the injured list with a right pectoral strain the next day[23] where he remained for the rest of the season.[24] On November 2, Hernández was outrighted to the minors,[25] but rejected the assignment and chose to become a free agent.[26]
Los Angeles Dodgers
On January 12, 2024, Hernández signed a minor league contract with the Los Angeles Dodgers.[27] He began the season with the Triple-A Oklahoma City Baseball Club before having his contract purchased on May 15.[28] In five appearances for the Dodgers, Hernández struggled to an 8.38 ERA with six strikeouts across 9+2⁄3 innings pitched. He was designated for assignment by the team on May 31,[29] and outrighted back to Oklahoma City on June 6.[30] However, Hernández rejected the assignment and became a free agent.[2]
Milwaukee Brewers
On June 8, 2024, Hernández signed a one–year, major league contract with the Milwaukee Brewers.[31] In four appearances for Milwaukee, he posted a 3.00 ERA with two strikeouts across six innings pitched. On June 19, Hernández was designated for assignment by Milwaukee.[32] He elected free agency on June 25.[33]
LG Twins
On July 20, 2024, Hernández signed with the LG Twins of the KBO League as a replacement for Casey Kelly, who had been released.[34] In 11 games (9 starts) for the Twins, he posted a 3–2 record and 4.02 ERA with 55 strikeouts over 47 innings pitched.
On November 28, 2024, Hernández re–signed with the Twins on a $1.3 million contract.[35]