1: Find two top layer corners that are next to each other and share one color besides the color of the top face.
2: Turn the top layer until those two corners are between the faces of the two colors they have in common (the color of the top face and the other one mentioned in step 1)
You should now have 2 pairs of corners: A front pair sharing the color of the front face, and a back pair sharing the color of the back face.
3: Check to see which pairs are switched. If a pair is switched, the corner that shares a color with the left face is on the right and the corner that shares a color with the right face is on the left.
4: Use one of these algorithms to switch the pairs that are switched. If none are switched, skip this step.