Hello there @cfsdf321!
UE5 has incorporated a DoF effect with different settings to achieve multiple setups. An effect that blur distant objects only should be simple to create by playing with Focal Distance, setting it in a way only far elements are covered. You can check all features in detail, by following the guides below: