There are a number of ways; let me count them:
By not taking a haircut
By not getting married (but to get engaged is OK, because Jewish Law views the supreme importance of certain areas of life, such as finding, with G-d's help, one's life partner, as over-riding the requirements of Sefirat HaOmer mourning).
By not listening to, or dancing to lively (mainly instrumental) music
How long is the Period of Mourning?
The period of mourning corresponds to the number of days on which, according to Jewish tradition, the students of Rabbi Akiva died. There are three main opinions:
They died for thirty-four consecutive days. This is the opinion of the "Mechaber," Rabbi Yosef Karo, the sixteenth century Compiler, or Editor, of the "Shulchan Aruch," the "Set Table," or Code of Jewish Law. His opinion represented, in general, the View of the Sephardic (Spain, Portugal, North Africa) Torah world.
According to this view, the mourning lasts till the morning (sorry; no pun intended), of the day after Lag BaOmer, which is the thirty-fourth day of Sefirat HaOmer, because of the principle of "Part of the Day is equivalent to the whole Day" with regard to certain matters, including mourning.
They died for thirty-three consecutive days. This is the opinion of the RAMA (Rabbi Moshe Isserles), roughly contemporary with Rabbi Yosef Karo, who in general represents Ashkenazic (West European) Jewry. He wrote a commentary on the Shulchan Aruch, called the "Mapa," the "Tablecover," expressing the Ashkenazic view wherever it differed from the Sephardic. When his comments were inserted within the text of the "Shulchan Aruch," the latter came to represent Jewish Law for all Jews, and the RAMA was considered a co-author with the "Mechaber" of the Shulchan Aruch.
According to this opinion, the mourning lasts till the morning of the thirty-third day; namely Lag BaOmer.
A third opinion is that the plague extended over the entire seven-week span of Sefirat HaOmer. But, since the plague was in any case, certainly according to this opinion, not following natural law, it subsided on Yom Tov, Rosh Chodesh, and on all of the Shabbatot within those forty-nine days. This took away sixteen days from the forty-nine, leaving the traditional number of thirty-three days of mourning.
There are other traditions, but the three listed above are the main ones.
From when till when is the mourning observed?
Here again there are two basic customs, and each individual should follow the practice of his community, or synagogue.
The partial mourning, as defined in the beginning of this section, should be observed on all days from the second day of Passover until the morning of Lag BaOmer.
The partial mourning should be observed from Rosh Chodesh Iyar through the 46th day of the Omer (excluding the "Shloshet Yemai Hagbalah," the three days preceding Shavuot), with the restrictions temporarily lifted on Lag BaOmer, and then restored.