I am not a Constitutional scholar, but my understanding is that a sitting POTUS can't be charged with a crime until after he or she is impeached by Congress, convicted by Congress, and removed from office.
Article I Section 2 of the Constitution grants broad pardon powers, but specifically excludes impeachment. Once impeached and removed, the ex-POTUS would no longer be able to pardon anyone.
Pre-emptive pardons to private individuals are allowed (pardoning before charges/conviction). But whether the POTUS could pre-emptively pardon himself was all argued out in the 1970's, and the general legal consensus is no.
But nobody's ever tried. The POTUS could physically sign the document. Whether it would be considered valid after the fact, is a matter for billable hours and popcorn.
But in any event, whether Trump goes to jail or not, he can't stop Congress from impeaching him - if they are willing to do so.