The basic idea is that gradle manages your dependencies, so you just say “I want okhttp3” and gradle automatically pulls all dependencies for okhttp3, eg okio and also all dependencies for that, etc.
The truth is that kotlin is meant to be used with a build system (mainly gradle but maven is also supported). While the command line works(it is actually used by all build tools) it is not well documented and not really used by anyone. The basics of gradle are pretty easy, but it can get very powerful (and complex) for big projects (look at the gradle files of the kotlin compiler ).
A simple example is here: https://github.com/gradle/kotlin-dsl-samples/blob/master/samples/hello-kotlin/build.gradle.kts
kotlin("jvm") version "1.3.21"
mainClassName = "samples.HelloWorldKt"
plugins section tells gradle that you are building an application (runnable, if you create a library just leave out that line) and that you are using kotlin plus the version.
For the application you need to specify the main class.
Than you have the
repositories blocks. Dependencies is where you put okhttp3, etc.
implementation("com.squareup.okhttp3:okhttp:4.2.2") // compile is also fine, if you create a library you should check the difference between "implementation" and "api". "compile" is the old system and works as well
repositories block tells gradle where to download the jars from. In most cases
jcenter() is enough, most libraries are uploaded there.
Also nearly all libraries will have an instruction of what to add to the
dependencies block in their documentation(okhttp3 example).
Also you should read https://kotlinlang.org/docs/reference/using-gradle.html
You can skip the end starting from annotation processing (this goes into some more advanced features). It also links some more examples at the bottom.
Once you have that set up you can simply build by typing
gradle build. Obviously this requires you to install gradle first.