Whether you're driving on the freeway or in the city, it is advisable to maintain a safe distance both from the vehicle in front of you and from those at the sides.
We can also add another action in order to increase your safety even more. We can normally drive in the center of the lane, but when there is a certain traffic density, it is good that we tend drive slightly over to the right of the lane.
This way we have a broader field of vision and we can see exactly what is happening if front of the vehicle we are following. Sometimes our height on a motorcycle already enables us to see what is happening in front of the other car. Nevertheless, driving along the side of the lane can be our salvation in case of sudden braking. In addition to the safety margin we have left with this vehicle we will also have the free space left at the side which may serve as an escape route to avoid a collision.
A similar situation arises when we stop at a traffic light. The best thing to do is to stop at the edge of the lane. This way we can prevent a distracted driver in the same lane from running into us if he or she can't brake in time. Whether the car manages to brake or not, he or she can pass by without colliding with us. At least we are creating space to enable the other driver to react and maneuver with a greater safety margin.