Query optimization in a Database Management System (DBMS) is a critical process. Its primary goal is to determine the most efficient execution plan for a given SQL query. This involves analyzing the query, considering available indexes, statistics on the data, and different ways to join tables or access data, and then selecting the plan that minimizes resource usage (like I/O operations and CPU time) and therefore reduces the execution time, making it cost-effective.