To drive defensively, you must manage the road space around your car. You can do that by controlling your speed, properly positioning your car in a lane and communicating with other road users.
The crucial concept is keep a safe distance from the car in front of you. The more space you allow between your car and the car ahead, the more time you will have to see a hazard down the road and avoid it! You will have to increase your following distance in some cases, e.g., when you follow a motorcycle, pull a trailer, carry a heavy load, drive in adverse weather conditions or slippery roads. The same rules apply to the sides and back of your car. Don't drive in the blind spot of another driver. The other driver may not see your car and could change lanes and hit you. And if you see someone is following you too closely brake lightly a few times to warn the driver behind you that you are slowing down. Change the lane whenever it is safe to lose the tailgater.