Ok, that is simple enough.
Go to the admin panel, and click emails, then the template sub-tab.
Select the template you are using, which is as likely as not the default, and probably the only one there!
Here you are presented with a series of templates. They are used for things such as letting a user know they have posted a message, letting staff know they have gotten a ticket, etc etc.
Using the variables is really pretty easy. Whenever you want to include data such as the ticketID, you use the matching variable - in this case you would use %ticketID.
So, instead of writing:
Hi, your ticket number is ????
you would write
Hi, your ticket number is %ticketID
Immediately before the email goes out, osTicket replaces the variables (such as ticketID) with the value you want to be in the email.
Have a go - you won't break anything by trying this (no promises, but it is highly unlikely!!)