Pablo Maffeo, on loan from Manchester City, put in an impressive performance for Girona, man-marking Messi throughout the game and stopping the 30-year-old from adding to his nine league goals of the campaign.
However, this approach from the newly-promoted side could not stop Barcelona restoring their four-point lead at the top of La Liga.
Own goals from Francisco Aday and Gorka Iraizoz set the visitors on their way to a sixth-straight league win of the new season, before Luis Suarez added a third with his 87th goal in 100 Barcelona appearances.
"The man-marking was clear and we had to find the place where to put Messi to move that player [Maffeo] and to get the most out of the situation," Valverde said.
"You have to take advantage of the situation. We tried to get the better of them by playing in the space and taking advantage of Leo's movement.
"I think Messi was fine. It's true that when you're man-marked it can be uncomfortable, but it also has advantages, not for him, but for the team. I think he was relaxed about it all.
"It was a difficult game because it was a derby, because of the atmosphere and the tension, but I think we managed it well. Maybe we struggled to finish the game off, but we've got the win."