If there was a specific answer to that, everyone would be at the top, and that would form a paradox. There are too many things to consider, if you are talking about youtube, you have to consider the niche, keywords competitivity, video optimization, number of views, likes, dislikes, comments, number of keywords, title, description, tags. Optimize everything and you will rank your video
Well, it's not easy to rank video on top of search engine. It depends on a lot of factors, like the niche, competition keywords, views, likes etc. Optimization of keyword must be done correctly. But I haven't seen much videos on top of google.
Actually, if you can fulfill the basic requirements, like having some video views, some comments as well, that would be a good indicator for the SE to list your video in the process. If you notice - there's a specific 'video' tab on the search engine, and when you click on the video tab, it shows you all the relevant videos according to the keyword that you have searched.
If you can fulfill the basic requirements, your video will have very good chances in getting listed high on the 'video' tab on the SE.