Warning: SPOILERS for Star Wars: The Last Jedi are ahead!
Despite initially refusing to train Rey in the ways of The Force in Star Wars: The Last Jedi, but he eventually relented and passed on some knowledge about the Jedi to the heroine. Much like Luke's training period with Yoda in The Empire Strikes Back, Rey learned quite a bit from Luke during their short time together on Ahch-To. It turns out, though, that there was a significant subplot cut from The Last Jedi's theatrical release which showed Luke teaching Rey a valuable lesson about how the Jedi can't involve themselves in every conflict.
One of the deleted scenes attached to Star Wars: The Last Jedi's home release opens with Rey, having just received from Jedi guidance from Luke Skywalker, looking at the Ahch-To shoreline and and seeing a line of lights on the sea heading to the village where the Caretakers live. Luke informs Rey that those lights are from a warring tribe that's come to raid the village, and Rey can't help but want to grab her lightsaber and rush to help the Caretakers. Luke tells her that even if she could help, that warring tribe would just come back a few weeks later with more fighters, and Rey might not even be around then. In this instance, Luke says that a Jedi would stand aside and let the conflict play out, but Rey opts not to do that, instead running to the shoreline with her lightsaber ignited, a moment shown in The Last Jedi teaser trailer. In the end, she learns that an actual raid wasn't unfolding; it was just a party amongst the Caretakers.
When Luke Skywalker started teaching Rey in The Last Jedi, he said would teach her three lessons, but only two of those were mentioned in the movie. While it might seem that Luke's suggestion to Rey about standing back is that third lesson, director Rian Johnson told EW that isn't the case, and that this scene was meant to show that Rey can't fully trust Luke anymore. As Johnson put it:
Rian Johnson also felt that Rey's frustration with Luke Skywalker was necessary to drive her closer to Kylo Ren in their Force conversations, but because this scene was deleted, Rey leaves off in a better place with Luke right before their dynamic falls apart and she decides to leave Ahch-To and try to bring Kylo back to the light. Johnson continued:
As for Luke Skywalker's yet-to-be-revealed third lesson, while Rian Johnson noted that there are things in The Last Jedi that fans could interpret as the Jedi Master's final piece of wisdom to Rey, the director doesn't want to share anything more in case J.J. Abrams decides to outright state what the lesson is in Episode IX.
Star Wars: The Last Jedi will be available for digital purchase starting March 13, and the Blu-ray and DVD copies will hit shelves on March 27.