The YPG is not and never has been a terrorist organization. Erdogan knows it and so does Donald Trump. The YPG is loosely affiliated with the PKK, and the PKK renounced violence as a means of conflict resolution long ago. Erdogan only hates the YPG and the SDF because they are democratic. They are for equality for women. They are for taking care of everyone equally, not for favoring the rich over the poor but for leveling things up and giving everyone equal and free education and healthcare and all the other basic necessities of life.
They aren't ethnically focused. All ethnicities are equally welcome and treated as such. Erdogan is for the Turks above all.
He is for being rich over the rest of humanity. He lives like a king of old, an absolute and totally spoiled monarch, and acts like one too.
If it comes to choosing between Erdogan and the YPG, I'll choose the YPG every single time. Are they perfect? No. They are better, much better, than Erdogan, though.