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: //social.msdn.microsoft.com/Forums/office/en-US/867bcacd-d378-411a-849a-fc040de9e5da/automumbe …

https: //social.technet.microsoft.com/Forums/en-US/8854540d-6a6b-409e-b6ce-1ee57bfa7df5/auto-create-f …

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