Do some every day and build it up.
Do you "just" want to be able to walk 10km or do you want to make it in a special time? How long are you walking already? What is the longest distance you did?
You can start easy and do more a little every day. Or you can do 3-5 longer walks a week, increasing the time for 5-10 minutes every walk you do.