You should use ElementRef when you need to directly manipulate DOM elements in a way that Angulars data binding and lifecycle hooks cannot achieve. However, it should be used with caution, as it bypasses Angulars change detection.