Shaving the beard is forbidden, this is the opinion of the majority of scholars and it is the preponderant opinion. The evidence of this opinion is what is reported in several authentic Ahadith that indicate growing the bread.
Imam Bukhari narrated from Nafi` from Ibn `Umar [ may Allah be pleased with both of them ] from the Prophet [ Allah bless him and give him peace ] that he said,
“Be different from the polytheists: let your beards grow full and shorten your mustaches.”
However, the Shafi’e Madhab argues that it is Makruh (dislikeable) to shave the beard; this is the prevailing opinion of their Madhab. The Shafi’s scholars say that the Hadith mentions the order about leaving (not shaving) the beard and trimming the mustaches. The majority of scholars do not say that it is recommended to trim the mustaches but it is only a Sunnah. So, they say how some of the Hadith is interpreted as a mandatory act while the second part of the same Hadith is interpreted as a Sunnah act although the verb used is the same and the order is the same.
In conclusion, it is more cautious to follow the opinion of the majority of scholars who are of the view that the beard should not be shaved.
The majority of scholars who are of the view that the beard should not be shaved, do not forbid trimming it. However, there is a difference of opinion regarding trimming it, i.e. the extent to which the beard could be trimmed. Some say that the minimum is to leave a fist (a handful of long hair), and some others say that it could be trimmed to the extent that it does not change the creation of Allah reflecting what truly a beard is. Meaning that it should not be more of a stylish beard for good looks rather than a worship act to submit to the will of Allah.