Small Aircraft; Low Wing; 1 Eng; Fixed Gear
Flight Crew Air Transport Pilot (ATP); Flight Crew Multiengine; Flight Crew Instrument; Flight Crew Flight Instructor
Flight Crew Last 90 Days 15; Flight Crew Total 25000; Flight Crew Type 500
Confusion; Human-Machine Interface; Workload; Situational Awareness; Time Pressure
Aircraft Equipment Problem Less Severe; Airspace Violation All Types; Conflict NMAC; Deviation - Altitude Excursion From Assigned Altitude; Deviation - Track / Heading All Types; Deviation / Discrepancy - Procedural FAR; Deviation / Discrepancy - Procedural Published Material / Policy
Flight Crew Took Evasive Action
Aircraft; Human Factors
Arrival to ZZZ from ZZZ1 via the ZZZZZ Transition through ZZZ2 Bravo airspace. Tracon kept me at 3000 ft. MSL until west of ZZZ due other traffic. Released me to descend and squawk VFR. I turned to the east to overfly ZZZ and enter a left downwind. Realized that I had traffic 300 ft. directly below me via the ADS B display.  turned right to proceed westbound again and climbed to about 3200 ft. MSL (into the ZZZ2 Bravo airspace) to get spacing with the traffic below me. Still did not have that traffic in sight. Eventually turned east again; got the traffic in sight and descended for uneventful landing. I never did get the transponder to squawk VFR until after landing.
Single Engine Pilot reported a NMAC and airspace violation while entering the pilot's intended destination airport traffic pattern.