Ingrown hairs can be painful and unsightly but also, easily prevented and remedied.
Ingrown hairs (or psuedofolliculitis barbae) occur when hair curls back on itself and burrows into its own follicle or into nearby skin.
Simple fixes include anti-bacterial agents along with salicylic acid to help keep skin free of debris and dead skin, allowing hairs to grow naturally. You can also free ingrown hairs with tweezers.
It's advisable to exfoliate the beard area twice a week with a face scrub to keep skin free of dead skin cells and lift any hairs that are ingrowing.
Further reading: Ingrown Hairs (Guide).