I was trying a tutorial and the mesh suddenly turned like this

Do you have a link to the tutorial you were following? Is it a landscape that you were painting?

Yes I was following the Tutorial by unreal sensei on Unreal engine 5 and I was arranging cliff meshes and those meshes suddenly became spikes like these
Link to the tutorial :- Unreal Engine 5 Beginner Tutorial - UE5 Starter Course - YouTube