A Perth aged care worker who admitted forcing a resident aged in his 80s and living with dementia to perform a sex act is sentenced to two years in prison.