If I need to change a text on an image how can a match the color of a new added text to be same as the surrounding one ? tutorial is showing that but didn’t show when there are in different layers
The video shows how to erase type that has been rasterized and, then, type in new type. First off, that problem shouldn’t exist unless you’re modifying someone else’s artwork who was foolish enough to rasterize the type to begin with. Photoshop is absolutely not the tool for creating ads like the one shown in the video. InDesign or Illustrator should be used instead. There are several dozen reasons for this, but that’s a tangent away from answering your question.
As for your question, there is more than one way to copy a color from one spot and apply it to type. Here’s the simplest: using the eyedropper tool, place it over the color you want to copy then click your mouse button. The color from it will be picked up. Now select the type tool. The color should carry over to it and be used when you type whatever it is you want to type.