You don't explicitly run the query optimizer. It is a component of SQL Server that is used to decide the best way to solve a query. It will decide which indexes to use, which table will be the inner when doing a nested loops join, if there will be an explicit sort or is an index available to do the sorting. That kind of stuff. If you interested, pick up a copy of Delaney's Inside SQL Server 2000.
-Mike