An accrued expense is essentially a liability that represents an expense that has been recognized but not yet paid. For instance in a particular month you might not have received your electricity bill. But to match your income during this month with the relevant expenses you need to accrue the electricity expense in your books.
On the other hand, a deferred expense is an asset that represents a prepayment of future expenses that have not yet been incurred. For instance you might have paid the next year's insurance premium this year, then it is recorded as a prepayment/deferred expense.