Ofcourse a president can pardon himself...but even if he couldn't...in the last hour of his presidency he resigns, pence is sworn in and pardons Trump.
Easy, simple, and only takes minutes.
You'd still need some charge/conviction to be pardoned. You can't pardon the air.