This all depends on if you like Apple stuff or Android and where your accounts and files are saved to now. They are both pretty equal otherwise, there is no simple answer here.
In my opinion, they both are good but when it comes to price, the iPhone x is worth for the price.
On the other hand, Samsung provides extra features with lesser price as compared to iPhone x so I would suggest you to go for S9+