Skyhawk 172/Cutlass 172
Flight Crew Instrument; Flight Crew Commercial; Flight Crew Flight Instructor
Flight Crew Last 90 Days 18; Flight Crew Total 642; Flight Crew Type 384
Distraction; Situational Awareness
Conflict Airborne Conflict; Deviation - Track / Heading All Types; Deviation / Discrepancy - Procedural Clearance
Air Traffic Control Issued New Clearance; Flight Crew Took Evasive Action; Flight Crew Became Reoriented
Human Factors
Student Pilot flying. On the 45 to enter downwind on [Runway] 16; at approximately 1;100 ft. MSL (TPA 1;000 ft.); a turn in the opposite direction caused potential collision with traffic on crosswind turning to downwind.  Situation was realized simultaneously by Tower and myself (CFI) at which point I took [control of] the airplane; as I saw other planes in the base for [Runway] 16. 'Traffic to follow' was mis-identified. To avoid collision the turn was continued to the left; away from downwind; at which point Tower instructions to climb to 1;500 ft. MSL and proceed east to a known reporting point were followed.  Situation was stabilized; instructions from the Tower to re-enter the pattern for 16 were followed and successfully completed.What contributed to this situation:1) Student and CFI not adequately briefing the approach based on ATIS.  2) Not correctly identifying 'traffic to follow'.    3) Student Pilot did not realize she could ask for clarification or question my thinking.  4) I did not have the correct runway (16) approach visualized; I was distracted with coaching the Student Pilot.How to avoid in the future: Slow down the process to adequately brief the approach and ask for questions to understand that my student and I are thinking the same procedure with the given information.  Properly identifying the 'traffic to follow' and verifying with Tower.
C172 Instructor Pilot reported an airborne conflict occurred in the traffic pattern when a 'follow traffic' clearance resulted in mis-identifying the aircraft to follow.