To save custom objects into preferences in Kotlin, you can use the Gson library to convert your custom object into a JSON string and then save that string into preferences. First, add the Gson library to your project by adding the following dependency to your build.gradle file:implementation 'com.google.code.gson:gson:2.8.6'Next, create an extension function that takes the custom object as a parameter, converts it to a JSON string using Gson, and then saves that string into preferences.