Firstly, try to pick a lane that matches your speed.
Make you sure you have enough room to swim the stroke you intend to swim. Therefore if you are swimming breast-stroke or butterfly, be careful of your wide arm swings and pulls either above or below the water.
If you are using equipment, ensure that you will not hinder or injure other swimmers. For example, if using paddles or fins, take care not to hit other swimmers. The life guards will often have issues with you should you look like you are flailing around the pool.
If you are swimming one or two lengths at time, try to pick a gap at which to join in, preferably behind a swimmer who is faster than you.
If you do catch up with a slower swimmer, then go around the swimmer to the centre of the pool aiming to complete the length before the overtaken swimmer has touched. This can often be challenging as it may involve a sprint.