When your customers pays you in advance, you'd:
Dr Cash xxx
Cr Unearned service revenue xxx (liability item in balance sheet)
When you've provided the service, you'd
Dr Unearned service revenue xxx
Cr Service revenue xxx (revenue item in income statement)