number of targeted keyword / number of words in the page.
So, if you target "best shoes for running". This is 4 words keywords.
If you mentioned it in your page once and ur page has 400 words, this means u have 1% keyword density.
4 (Mention of targeted keyword cuz its 4 words) /(divided by) 400 = 1% which is too high btw.
So, for such keyword u need +600 words article and one mention in the title
And this is sir why many people believe keyword density doesn't matter anymore

Cuz in most cases they don't need to mention it in their threads as google already knows what u are targeting from the title.
If you are starting, don't use the keywords more than twice in the article and use many of lsi keywords instead. So, running shoes, jogging , sneakers, sports footwear ...etc