Kittens will usually have learnt to use a litter tray by copying their mother. Just place them on it after waking up, meals, or when seen sniffing, scratching or crouching. Use cat litter and not soil, especially when they are not yet fully vaccinated. Put the tray in a quiet, private area away from food, water bowls or their bed. Clean it frequently with very dilute bleach and rinse with boiling water.
If your kitten doesn’t use a litter tray and you have done all of this, then you may need to confine them to a small room with the tray for a while.
When your kitten starts to go out, move the tray closer and closer to the door and spread some litter onto the soil outside. Keep the tray until your kitten has started using the garden.