What's the most Important thing to look on datasheet when Replacing a Transistor with another one?
This answer is much like what you see in comments, but I thought I would give it some order:


Exact package type, Pin-outs and pin spacing. Mandatory.
Transistor type. JFET, MOSFET or BJT. Mandatory.
Transistor polarity. PNP/NPN or N-channel or P-channel. Mandatory.
Operating voltage (max), and maximum continuous current. Mandatory. Note that a small increase in maximum voltage and/or current rating is ok, as long as other parameters are close to the original part.
DC gain (hFE or beta). Some transistors are designed with a very high gain. Mandatory.
Gain bandwidth. Is it for DC power, audio, RF low band, RF UHF band or higher. Mandatory.


There are more details in good datasheets but become more esoteric unless it is pointed out in a schematic or application notes. The gate resistor for a MOSFET for example. Don't buy a beefy MOSFET to replace one that had a latent failure. Oversize the current rating by a small amount if at all.

A much higher-current MOSFET may fit into your circuit but it will have a much higher gate capacitance, so its driver may heat up and the circuit is not efficient anymore. The same goes for NPN or PNP power transistors in a TO-126 package or larger. Pay attention to the DC gain. Some may have a gain of 100 while older transistors may have a gain of 10.

When dealing with special transistors for RF or JFET or MOSFET types, then attention to fine details are very important. Base or gate capacitance and FET idle current become very important.

Yes, lots of parameters to look into, but for generic stuff like DC power supplies and basic audio the first 6 lines count the most. For RF or switching power supplies look at ALL the details.

Do NOT buy transistors with no datasheet! Note that buying up lots of older outdated transistors is not always a good idea. Beware of parts brokers who do this for a living.