If the suit is divided West 109 and East J542 you need to finesse.
If the suit is divided West J109 and East 542 you need to play the Queen.
What should you do is determined by what will work most often.
If West has J109, he can play any two of the three cards on the first two rounds of the suit.
In other words there are 3 combinations (J10, J9 and 109) that could have been chosen
If he has 109, J10, J9 doubleton, he has no choice and must play the cards he was dealt.
IF YOU ALWAYS FINESSE, YOU WILL WIN THREE TIMES FOR EVERY ONCE YOU LOSE
This is called the Principle of Restricted Choice.
As an aside, if East is a player who will always show count in the suit and plays 2, 4 then 5 in that order (showing an odd number), you may decide to go against the odds and drop West’s Jack.
You need to know your opponent well to play against such heavily weighted odds!
This is called table presence!