Although determining the sex of an older, larger dragon is usually pretty straightforward, younger dragons can sometimes be hard to sex. Some males develop slower than others and may appear "female" until they've grown a bit!
Bearded Dragons can often be sexed from as young as 6 weeks, although at this age there are no 100% guarantees! It's not "guaranteed" until around the 6 month mark, which is why we cannot 100% guarantee the sex of any dragons sold which are younger than this.
In general, most males can be identified at a few weeks of age. The remainder will virtually all be female, possibly with the occasional "slow-developing" male mixed in.
To determine the sex of your bearded dragon, hold it in your hand with the head facing away from you, then gently lift the tail to around 90 degrees. Do this gently, and don't lift the tail any further or you risk damaging the spine.
Male bearded dragons have hemipenal bulges either side of the base of the tail, right after the vent. A hemipenis is literally a "half-penis". It is so-called because many male reptiles actually have two penises (one either side), so it doesn't matter which side of the female they are on when mating takes place.
Even young males will usually show these bulges, as can be seen in the second photo. Look at the patch of skin in the second photo that's getting ready to be shed and you'll be able to see the bulges:
Female dragons can be a bit less obvious, especially when young. They don't have hemipenes, so will lack the bulges, but will sometimes have a smaller, centralised bulge immediately after the vent. In babies, this bulge can sometimes be quite well defined, as in the case of the second (juvenile) female:
There are several other methods sometimes used to sex bearded dragons, but we generally find them to be less accurate. They are often highly subjective, which can cause people to "see" what they want to see, rather than what's actually there!
Generally-speaking, females will have smaller, less-well-defined femoral pores, smaller vent openings, and sometimes narrower heads. However there are many exceptions to these "rules" (some females have obvious pores, large vents and "blocky" heads), so I would recommend avoiding them.
When used in combination with tail-sexing they can be useful, but on their own they should not be relied upon nor 100% trusted.