As an autistic person how do you stay motivated (more specifically doing long tasks)?

Mostly asking for other people on the spectrum, but allistics are free to comment also.