Use a multimeter or a simple tester (battery, resistor and LED) to check each pair of leads for conduction. Set a digital multimeter to diode test and an analogue multimeter to a low resistance range.
Test each pair of leads both ways (six tests in total):
The base-emitter (BE) junction should behave like a diode and conduct one way only.
The base-collector (BC) junction should behave like a diode and conduct one way only.
The collector-emitter (CE) should not conduct either way.
The diagram shows how the junctions behave in an NPN transistor. The diodes are reversed in a PNP transistor but the same test procedure can be used.