The counting of the Omer comes from Leviticus 23:15-16, and Deuteronomy 16:9-10 in which G-d commands the Israelites to count 50 days, or seven full weeks starting on the second day of Pesach. The 50 days is because on the 50th day we celebrate Shavuot.
The Torah commands us to count the days from the second day of Pesach to Shavuot, kind of like a countdown. The Omer is a measure for dry goods equivalent nowadays to roughly one gallon or 3.65 liters. In biblical times, an omer of barley was brought to the Temple as an offering.
So, every night at sundown but before midnight, we recite a blessing and we count the days to the Omer. If you forget to say the blessing during those times, then you only count the day the next day, but without the blessing. That is, for example, on the 20th day after the second day of Pesach, at night you say:
“BARUCH ATAH ADONAI, ELOHEINU MELECH HA’OLAM, ASHER KIDISHANU BIMITZVOTAV VITZIVANU, AL SEFIRAT HA’OMER. (Blessed are You, Lord our God, King of the Universe, who has sanctified us with His commandments, and commanded us concerning the counting of the Omer.) TODAY IS 20 DAYS, WHICH IS TWO WEEKS AND SIX DAYS OF THE OMER.”
The reason you count the day AND the week is because in years gone by, the rabbis were not too sure whether to count one or the other because Exodus says to count 50 days, but Deuteronomy says to count 7 weeks, so they compromised and made us count both to be on the safe side.
However, if you forget to say the blessing during the night, you only count the day (Today is …..) without the blessing the following morning or day, then at night you catch up with the new blessing and day. They have apps for the counting of the Omer, which remind you of the number of day and the prayer, plus it gives you a nice thought for the day.
Kabbalistically, the number 49 refers to the 49 godly human character qualities. And the number 7 in the seven weeks refer to the seven Divine qualities or attributes. Each day and each week, you remember each one of these qualities, and pray hard to acquire them. So, basically, the counting of the Omer is a time for introspection and striving for perfection by being aware of the long list of these attributes (It will be easier if you just Google them, instead of me writing them here) . Again, one thing is what G-d said to do and another is what the sages added to it later on. Most Jews try to be inspired by those traits, while others just say the prayer and the number of the day, like G-d commanded, and be done with it.
Another event that is celebrated during Omer is the harvest of barley from the first grain to the peak of the agricultural bounty of it. THAT is real reason we count the Omer, but it overlaps with Shavuot.
Some homework…. Since it is a commandment (Mitzvah) to count the Omer, does each day count as a Mitzvah fulfilled, or are the 50 days of offering the prayer altogether when the one Mitzvah is fulfilled?