When I was about 13, my mom used to take me to YMCA in South San Francisco where I learned how to do various swimming basics such as the flip turn. Btw, YMCA has the god-awful smell of urine, I try to avoid them nowdays.
Anyways, enough about my life, here’s how you can learn online on how to do a flip turn, a must if you want to keep swimming fast in the lap pools.
My advice for a quick flip turn on a freestyle stroke: Simply start flipping before you reach the end of the pool and make sure your legs are ready to jump back out.
For backward strokes(or strokes where you are seeing the ceiling): Try to mark a point in the ceiling where you know you have reached the end of the pool lane and start flippin.