In Kotlin, you can create a custom exception by defining a new class that inherits from the Exception class or one of its subclasses. For example, you can create a custom exception called InvalidInputException as follows: class InvalidInputException(message: String): Exception(message) You can then throw this exception wherever you need to in your code, using the throw keyword: fun checkInput(input: String) { if (input.isEmpty()) { throw InvalidInputException("Input cannot be empty") } // continue processing input }