Incremental numbering that is added to the existing file name or in a new column each time a new item is added in SharePoint Online

I need your help where I want to create an automatic incremental numbering for the file and the name of the folder where, each time a folder / file is added to the library, the file name is added with the incremental number of the previous one. The numbering must be incremental according to its relevance in a particular folder.

I was researching and I tried to refer some publications where it suggests to create SPD workflow, but I could not find actions and logic.

Reference article
https: // …

https: // …

Is this possible in SharePoint Online? If so, please help me through the steps.