Meaning of “Trick or treat!” - Learner’s Dictionary

Trick or treat!

something that children say on Halloween (= a holiday on 31 October), when they dress to look frightening and visit people's houses to ask for sweets

go trick or treating

If children go trick or treating, they visit people's houses on Halloween to ask for sweets.

(Definition of “Trick or treat!” from the Cambridge Learner’s Dictionary © Cambridge University Press)