There are a few things you need.
1, A device that stays at home, (HomePod, Apple TV, OR iPad that always is at home)
2, A Homekit compatible fan
Casablanca Aya - 54” Ceiling Fan
Hunter Advocate Low Profile - 54” Ceiling Fan
Hunter Apache - 54” Ceiling Fan
Hunter Signal - 54” Ceiling Fan
Hunter Symphony - 54” Ceiling Fan
Or another that isnt listed (Check with Manufacturer for HomeKit compatibility)
3, The Apple Home App (You don't need shortcut for automation)
https://apps.apple.com/us/app/home/id1110145103
And Finally
4, How to set up automation - https://support.apple.com/en-us/HT208940