4 dts 7 segms display, how to programme it(not just by copying someone's code)

Hello, I am newbie in arduino programming and I found myself in doubt. I have programmed my arduino to BCD values from 0 to 9 and I connected it to a HCF4511BE that connects to the display. I am aware that the four digits are connected to each other. I can display the same number in every digit, however, I would like to know how I can make a sequence that goes, for example, from 0 to 99? I would not like to just download someone's programme and just not be able to explain what I "did". Please, note that I do not have any other BCD with me. Thank you

First you need to show us a diagram of exactly how you have connected everything.

See the instructions.

Sorry, here it is Sir

OK, so you have an antique 4511 chip decoding BCD from the Arduino to one digit on the display.

The display is a common cathode type where all corresponding segment anodes for different digits are connected together and all the cathodes to a given digit are connected together. When you feed the segment anodes from the 4511, if any common cathode is grounded, that digit will show whatever numeral is decoded.

If you connect more than one cathode to ground, more than one digit will show the same pattern.

To show different patterns on different digits, you require to multiplex the display. This means you ground the first common cathode while you deliver the pattern for that digit, then disconnect the first digit cathodes, connect the second to ground and deliver the pattern for that digit - and similarly for the remainder of the digits.

Two considerations here are that you illuminate each digit for just the same length of time in order that all digits show the same intensity, and that all four digits are successively illuminated within every fiftieth of a second so that they are seen to the eye as continuous.

All in all, it is much easier and more practical to use a chip designed specifically to do all this for you such as the MAX7219 which is readily available in pre-assembled or un-assembled display modules on eBay and Aliexpress.

Thank you very much Paul, your words are of great importance!