Convert the number to an array of digits. For each digit, you want to know if there's a larger digit somewhere to its right. If so, swap with the rightmost occurrence of the largest such digit.
Why rightmost? If there are multiple copies of the same large digit, swapping with the one furthest right keeps the other copy in a higher position.
Scan from left to right. For each digit, check if a bigger digit exists to its right. The first position where this is true gives you the best swap, because improving a higher-order digit has the most impact.