Consistency. Awards. Punishment.
Consistency - Have a bed time. Small children need about 10 hours of sleep at night. My 5 year old goes to bed at 8:30 and wakes up at 6:30. Have a homework time. Have a play time, bath time, and keep meals about the same time also. This keeps the child in a school like structure and keeps his mind and body healthy.
Award him for doing well with stickers, small toys, candy, or other objects of affection. I give my son a little bit of money that he saves in a can and then take him shopping once a month.
Punish him by taking things away. My son knows that if he gets in trouble on the bus he can't play on the computer.
Sometimes kids need to understand that their are some things they just have to do whether they like it or not. School may be one of them.