Trump can't pull the USA out of NATO. Included in the NDAA, passed by Congress in December 2023 and signed by President Biden, was a provision requiring congressional approval. Congress, including Republicans, didn't want Trump to do this.
Regardless, whether or not Trump knows that he can't, we don't need a bellicose president or candidate threatening our allies that we'll abandon them, or worse, inviting Russia to attack.
Smart leaders know the value of allies.