I want to do some square hole on the PCB board simply (can be pervious to light), or dig some slot, could you advise me with what method?And I use the software is Allegro, thanks!
Square holes are expensive. Consider round holes if the holes are of small size.
Holes will be made using a carbide router bit by the fabricator but the corners will be somewhat round. As pointed above by marce, the corners will not be sharp.
Your software will have some indication for these slots or holes and the PCB fabrication process will interpret them correctly.
Slots should be covered by the drill data if excellon II format is used. Having holes routed in a PCB does not add that much cost especially if the board is routed out of a panel, also 3mm and above non-plated holes are often routed rather than drilled.