In NestJS, you can generate a CRUD resource using the Nest CLI command `nest g resource [name]`. This command sets up a new module with all necessary files and configurations for creating, reading, updating, and deleting resources. You can specify additional options such as `--no-rest` and `--graphql-code-first` to tailor the resource to your needs.