To define a new controller in Yii 2, follow these steps:
- Create a new PHP file in the controllers directory of your Yii 2 application (usually located in the frontend or backend folder).
- Declare a new class that extends the yii\web\Controller class. For example, you can name it YourController.