How can I improve my ranking in relevant search filters despite keyword optimization in titles?

I carefully incorporated relevant search query keywords into both my title and subtitle, but when I first searched for that keyword, my result didn’t appear on the first page. However, after switching to the latest courses filter, my result ranked at the top. Do you have any suggestions for improving my ranking in the relevant filter?