We know how to do it because Einstein showed us the way over a hundred years ago. It’s surprising how few people actually really know about this in their bones. He showed that if you go out into space and travel near the speed of light, and you turn around, and you come back, your clock will be ticking off time more slowly. So, when you step off it's going to be the future on planet Earth. You will have time traveled into the future.
Einstein gave us a second way to reach the future:
[I]f you hang out near a nice strong source of gravity — a neutron star, a black hole — and you kind of get right near the edge of that object, time also for you would slow down real slow relative to everybody else. And therefore, when you come back to Earth, for instance, it'll again be far into the future.
Physicists agree on these two ways to reach forward in time, but what have we discovered about traveling to the past? Many think it impossible, but those holding out hope turn to wormholes:
It's a bridge, if you will, from one location space to another. It's kind of a tunnel that gives you a shortcut to go from here to here. Now [Einstein] discovered this in 1935 but it was subsequently realized that if you manipulate the openings of a wormhole — put one near a black hole or take one on a high-speed journey — then time of the two openings of this wormhole tunnel will not take off at the same rate, so that you will no longer just go from one location in space to another, if you go through this tunnel — through this wormhole — you'll go from one moment in time to a different moment in time. Go one way, you'll travel to the past, the other way, travel to the future.
Alas, physicists do not know for sure if wormholes are real, and so in turn any theorizing about time travel through them is hypothetical at best.