Win10 comes installed with all DirectX 9,10,11 and 12 files.
What brand and model cpu and graphics processor does your machine use ?
Or... More to the point. DirectX errors are commonly generated when a graphics processor is either not capable of using a particular DX version,
or the gpu is faulting.
If you have only recently started having this issue with certain games (eg - Minecraft Windows ed, Fortnite and
some other popular online games ) it is because a number of popular games have been updated in the past year or so and
no longer use DirectX 10 effects. The new 'seasons' of these games now use only DX11 and 12.
This means that machines which use Intel HD 2000\3000 graphics (or similar older graphics processors) are no longer compatible
with those games as these older gpu's are limited to using DX9 & 10 effects in games.
.