Hard work, and lots of it.
Seriously, there's no magic bullet solution. It might be in a file called "text.bin" in the "script" directory, or it might be in "03DF8540.dat" in a directory called "an". There's no guarantee where you'll find it, or even how it's stored. If you're working on a Japanese game, the text will probably be in Shift-JIS format, meaning you'll need
this table, but if the script is compressed, you'll need to learn some programming skills if you want to extract and reinsert text - the
usual tools won't cut it.