In my Gmail, I want to search a keyword that appears only in a specific folder.
Currently, it displays results from all folders.
By folder, you mean label right? If you navigate to a label, it should already populate the search bar with the format needed. So if I have a label called "Finances" the search should be
label:finances and then whatever you're searching for
If it's nested, it will be marked by a dash so if I have a "Bills" folder under that it would be
All you have to do is either go in the label or click on the little arrow on the right hand side of the search box.
For more info you can read about: Search operators you can use with Gmail