Red button is to close the file. If it is saved already, then it won't ask you to save it again and instead it will close. If the file is not saved, then it will ask you to save it or cancel the file before closing
Green button is to fill the Text Edit application in the entire screen.
Yellow button is to minimize or hide the Text Edit application to the dock without closing the application. Suppose, if you want to browse internet while creating a file, then you can minimize the file to the dock instead of closing it, then browse and then continue work later by clicking the Text Edit application in dock.
If you saved the file, check the location where you saved it. Do you remember where you saved it ?
Normally the files are saved in the Documents folder or in desktop. Can you see it in desktop ? If not, then it should be on your Documents folder.
In dick, click on the Finder icon (the blue smilie) icon. This will open your Home folder. Open Documents folder in there and can you see your file there ?