Response time
Yes, you are right to select 2N2222 transistor because it is used main for switching purpose. Such as to trigger a relay due to maximum allowable collector current is 1Am.
As shown in the figure, when 5V is applied to the base through R1, then the relay will trigger. The 5V can be from PIC or other power source with proper ground.
If you said you did touch the base with 5V and the relay can trigger then this is likely due to the fact of you program. Or, you can check the output voltage of that pin you use to trigger the relay. If you want to hit the base with a pulse then you should consider the relay response time because of the relay response time. It won’t trigger if the pulse width duration is 1us or even 1ms. A significant output should be 1 second or more.
In addition, most properly to trigger a relay, we don’t use MOSFET cause it is for fast switching and high power… :idea: