Planeswalker loyalty abilities are activated abilities with the timing restriction of a sorcery (CR 606.3b). This means you may activate them during your main phase, on your turn, while the stack is empty — which includes your first main phase (Pre-Combat Main Phase) before you declare attackers.
The turn structure places the first main phase (CR 505) before the combat phase (CR 506–511). Since a planeswalker loyalty ability can be activated any time you could cast a sorcery, your first main phase is a perfectly legal window to use one, as long as the stack is empty and you haven't already used that ability this turn.
Crucially, CR 606.3 also states that a loyalty ability may only be activated once per turn — specifically, no player may activate more than one loyalty ability of the same planeswalker per turn. So you get one activation of each planeswalker's loyalty ability per turn total, not one per phase.
Example: You control Chandra, Torch of Defiance. During your first main phase with an empty stack, you activate her +1 loyalty ability to exile the top card of your library and potentially cast it. After that resolves, you move to combat and declare your attackers normally.
Note: If you want to use the ability after combat, you can do that too — your second main phase (post-combat) is equally valid. The choice is entirely yours based on game strategy.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.