Step 1: Remove Yellow
Apply an HSL Adjustment.

Select the Yellow Channel, then lower the Saturation slider to remove the yellow.

Step 2: Add Blue
To counteract the yellow even more, you can add blue to the photo.
Apply a White Balance Adjustment.

Lower the White Balance slider to add more blue.

Step 3: Add Brightness
Apply a Brightness and Contrast Adjustment.

Raise the Brightness and Contrast sliders.

Step 4: Mask the Adjustments
All of these adjustments are applied to the whole photo, but they should only be applied to the teeth. You can fix that by adding a grouped mask.
While holding Shift, click to select all of the adjustment layers.

Group the layers by pressing Ctrl + G (PC) or Command + G (Mac).

With the group selected, apply a mask to it.

Invert the mask by pressing Ctrl + I (PC) or Command + I (Mac). This hides all of the adjustments under a black mask.

Step 5: Reveal the Adjustments
Select the Paint Brush Tool.

Paint in white on the teeth.

At this point, make sure that the teeth aren’t too white. Lower the Opacity of the whole group, or lower the Opacity of individual layers as needed.

Now you know how to whiten teeth in Affinity Photo. 😊