Just like other kosoado pronouns in Japanese, we can divide the meaning of these words this way:
- koko 此処
- soko 其処
- asoko 彼処
- doko 何処
The words koko ここ and doko どこ are very easy to understand and use as they're translated to very different words in English. Some examples:
- koko wa ii na ここはいいな
Here's good, right?
(this city, this country, this house, this spot on the beach, etc.)
- koko wa watashi no ie desu ここは私の家です
My house is here.
- soko wa heiki ka? そこは平気か？
Is everything alright there?
- soko wa tachi iri kinshi dakara そこは立ち入り禁止だから
Because that place (you mentioned) is off limits.
- asoko wa tashika ni kowai あそこは確かに怖い
There is indeed scary.
- okaasan wa doko desu ka? お母さんはどこですか
Where's your mother?
The greatest trouble would be its usage with the particle demo でも, which would result in:
- doko demo ii どこでもいい
Anywhere is good.
Wherever is good.
The words soko そこ and asoko あそこ, however, are a bit tricky. The word soko そこ is used for places that are next to the speaker or next to the listener, while asoko あそこ is used for things that are far away from both.
For example, you can say soko e iku そこへ行く, to say that you're "going there" to someone. That "there" can be three steps in front of you or, if you're talking on the phone with your friend on the Antarctic Circle, soko そこ can be on the other side of the world.