Yes, Keyword density play vital role for getting ranking.
Keyword density is calculated the ratio of keywords to the total word count of a given page.
Let's see here there are a few important things to keep in mind:
1. Keyword density depends on words count like top-ranking pages used their specific keyword approximately 8-10 times, while having an average of 1285 words on the page.
2. Word count has become a more important ranking factor than the number of keywords used.
3. Relevant words and phrases have increased in importance, and marketers and SEOs would do well to increase their focus on incorporating these words and phrases into their content, rather than on calculating keyword density.
Here provide how should keywords be used? There some few tips
* Position of keywords is more important than frequency. - Use the primary keywords in Title,H1,H2 ,Url and at least once within the body of the text content and no do more keyword stuffing on that page,its a spamming.
* Focusing on the long tail keywords
* Proper keyword research and analysis is still more importance for finding overarching topics as well as related and proof terms.