How to optimize queries which are already written?
If you can not change the them:
Indexes and statistics.
So you don't optimize the query but their execution plan.
If you can't change the query then it really depends on what features are available on your database engine of choice. As Ovidiu said you can use indexes and generate usage statistics to see where the bottleneck is.
Otherwise you can employ techniques like materialised views or horizontal partitioning.
Before you start make sure you know what you're optimisation target is.
IBM Informix Dynamic Server supports a feature that allows you to add optimizer directives to pre-existing SQL when it is executed (without modifying the application). Look up 'external directives' at the Informix web site for more information (or Google 'site:ibm.com informix external directives').