And from the day on which you bring the sheaf of elevation offering—the day after the sabbath—you shall count off seven weeks. They must be complete: you must count until the day after the seventh week—fifty days; then you shall bring an offering of new grain to God. You shall bring from your settlements two loaves of bread as an elevation offering; each shall be made of two-tenths of a measure of choice flour, baked after leavening, as first fruits to God.
Sefer HaChinuch, Mitzvah #306
Rambam, Moreh Nevuchim (Guide for the Perplexed) 3:43
Shavuot is the time of the Giving of the Torah. In order to honor and elevate this day we count the days from the previous festival until it [arrives], like someone who is waiting for a loved one to arrive, who counts the days by the hours.
ReformJudaism.org
The counting of the Omer (S’firat HaOmer), which lasts for 49 days, takes place at night, commencing on the second night of Pesach. Those who "count the Omer" recite a blessing each night of the 50-day period:
בָּרוּךְ אַתָּה יְיָ אֱלֹהֵֽינוּ מֶֽלֶךְ הָעוֹלָם, אֲשֶׁר קִדְּשָֽׁנוּ בְּמִצְוֹתָיו, וְצִוָּֽנוּ עַל סְפִירַת הָעֹֽמֶר.
Baruch atah Adonai Eloheinu melech ha’olam asher kid’shanu b’mitzvotav vitzivanu al sefirat ha’omer.
Blessed are You, Adonai our God, Ruler of the universe, who sanctifies us with mitzvot, and commands us concerning the counting of the Omer.
The count is stated in both total days (“Today is the twenty-third day of the Omer,”) and weeks and days (“which is three weeks and two days of the Omer.”)