How do you decide which way to finesse for an ace?
Playing low to Q, and then towards the K, covering RHO's card if RHO follows seems the right play.

If RHO shows out when you play towards the K, you can rise with the K and play towards the T the second trick.

This is basically 100% (caters to 3-2, 4-1 and 5-0 splits!)

The other option of playing to the K loses to the singleton A over the K, losing two more tricks to the J9x over the QTx.

This is intuitively similar to the combination

A9xx

opposite

KJxx

where you need 3 tricks.

The correct play is to play the K, and then play towards the A9x, covering whatever LHO plays. If LHO fails to follow suit, you go up with the A, and play towards the J.

The usual way to attack suit combination problems is to try and count the number of combinations where a line of play works. This can be time consuming at first, but in most cases, you can work out a reasonable line (not necessarily the best line) at the table.