The only thing you can do is travel with a clean device on which you maintain a completely innocuous social presence, such as chats with parents and non-foreign friends, and some social media with normie activity. Even that would not be enough if you're an activist or otherwise personally targeted, as your real accounts are already known in that case and your only option is not to travel at all, but it reduces your chances of getting in trouble (or arrested, depending on the target country). Though it still won't help in the long run as security services collect and organize more and more data about everyone.