Jesus tells Peter he will deny he even knows Him, then He explains He is the way, the truth and the life, the only way to know the Father, and the true vine: John 13:31–38; Mark 14:27–31; Matthew 26:31–35; Luke 22:31–38; John 14:1–15:17
What a promise from Jesus on the night of (and shortly before) His betrayal. We can ask anything in His name. Anything:
John 14:12-14 I tell you the truth, anyone who believes in me will do the same works I have done, and even greater works, because I am going to be with the Father. You can ask for anything in my name, and I will do it, so that the Son can bring glory to the Father. Yes, ask me for anything in my name, and I will do it!
Jesus said anyone, so it’s a promise to anyone.
But it comes with conditions:
John 15:5-8 Yes, I am the vine; you are the branches. Those who remain in me, and I in them, will produce much fruit. For apart from me you can do nothing. Anyone who does not remain in me is thrown away like a useless branch and withers. Such branches are gathered into a pile to be burned. But if you remain in me and my words remain in you, you may ask for anything you want, and it will be granted! When you produce much fruit, you are my true disciples. This brings great glory to my Father.