That would depend on the particular app.
Every App has its own Dictionary of commands. You have to look at the Dictionary for the App to see what commands it takes
System Events responds to the keystroke command, but it is kind of a universal program, so you have to make sure the thing you want the keystroke to appear in is frontmost.
For example, this will put text into a new TextEdit document.
tell application "TextEdit"
activate
make new document
tell application "System Events"
keystroke "Hello, World!"
end tell
end tell
The outer Tell block sets up a new document in TextEdit which was told to come to the front with "activate."
The inner Tell block instructs "System Events" to type the keys passed as a string.
You can run commands with System Events, also.
tell application "TextEdit"
activate
make new document
tell application "System Events"
keystroke "Hello, World!"
keystroke "s" using command down
end tell
end tell
That will add the text to a new document and send the Save command (cmd-s).
To view an App's Dictionary, use the Open Dictionary command from the File menu and find the App. If it is grayed out, it doesn't have a Dictionary and can't be scripted except as shown above with System Events.