DirectX related crashes are nearly always a result of multiple-overlays being installed.

Overlays install themselves into the displaylist swapchain, and overlays that are not aware of each other can step on each others toes. If this is a recent thing, uninstall/deinstall/disable the GeForce Experience overlay, Steam Overlay, Discord Overlay, etc until it works and then turn on just the ones you actually need.