If when you touch it starts moving that means that fan is faulty. If in warranty take it to get a replacement for the fan. If not you will have to take the fan out, clean, use some silicon grease and put everything back. If it does it the same the fan induction circuit is at fault and you will have to replace the fan all together.
iPhone X review