Brock Lesnar last competed against Cody Rhodes at WWE SummerSlam 2023 which ended in a losing effort. After this, he went on a hiatus that was supposed to end at Royal Rumble but that wasn't the case given the current circumstances.
The popular belief is that Lesnar did not make it to The Rumble since his name got associated with the s*x trafficking lawsuit against Vince McMahon. It was already reported prior to the match that Lesnar wasn't going to be in St. Petersburg for the PLE.

John Pollock of Post Wrestling has now been informed by a source that Brock Lesnar was originally scheduled to work with Dominik Mysterio at the 2024 Elimination Chamber Premium Live Event that will go down in Australia within a few weeks.
It was further revealed by Dave Meltzer on Wrestling Observer Radio that Bron Breakker wasn't initially planned to be on the Men's Royal Rumble fray. He was a last-minute addition, stepping into Lesnar's place.
"Bron Breakker was not scheduled for The Rumble. He was called up. They needed someone too look.. Brock was going to be in there looking impressive and they needed someone to fill those shoes. There wasn't a lot of guys they would have given that spot to."
Bron Breakker entered the Royal Rumble match as the 20th seed and had a dominant outing until he was eventually eliminated by Dominik Mysterio. After Breakker eliminated Omos, Dominik took advantage of a distracted Breakker and eliminated him.
This was supposed to be how Lesnar was planned to get eliminated and possibly begin the feud with Mysterio Jr. Time will tell if Breakker will continue that feud with the Raw roster member.
During a post-Rumble match promo, Breakker teased that he was not done with Dominik and Judgment Day which keeps the chances alive that he will eventually appear on Raw and go after Dom-Dom.
If this storyline does unfold on this week's episode of Royal Rumble then Bron Breakker (son of WWE Hall of Famer Rick Steiner) could also be heading onto WrestleMania 40 as Brock Lesnar is said to be dropped from the PLE card, too.