Using 2n2222 to switch relay on/off with 3.3v

As you are aware, HFE is a starting off point, perhaps an indication of the quality of the transistor and if it is a candidate as a switch.

Example let’s say a a transistor has a HFE of 10.
It might indicate this device is not the best for a switch application on the Arduino.

That being said let’s say the HFE of our 2N2222 was 100.

If 5mA goes into the base we can confirm ≈ 500mA could flow in the collector if the appropriate collector resistor was selected.
And you guessed it, during testing, this was indeed observed with the 33 transistors tested.

For transistor saturation action we want the Base to Collector to be forward biased as it was observed during testing.
For example Vce was 0.11V and Vbe was 0.73V. The measured Vbc voltage measured was 0.62V.
The transistor base to collector was forward biased. This resulted from selection of a 560 ohm resistor for the base using 3.3v as the input voltage, 0.11V for Vce also confirms the saturation.

Some times the rule of thumb using 10 times base current is suggested . . . this is almost always using an elephant’s foot.

As always mentioned, the EE must confirm the transistor is in saturation. This is done with either an oscilloscope or a DMM.
You would expect to see a very low Vce. If for example, you saw 3v Vce rather than the 0.11 volts, you know there is a problem . . .

What does HFE have to do with this ?
It tells you if you have a quality transistor, not much more than that.

But, you know all this stuff already.