considering the model

Yi=β0+β1Xi+ϵi, i=1,2,3,,n

how can i calculate the hat matrix and what would element hij be ?
thanks