If a write-in candidate won the November 2024 general election for President in some state, how would electors be chosen, since no political party had appointed electors in advance for that candidate?
The National Association of Secretaries of State publishes a summary of state laws regarding presidential elections.
As one may expect, the laws vary by state.
The write-in candidate must file and include a slate of electors,
The write-in candidate must file, but need not supply a slate of electors,
The write-in candidate need not file, or
Write-in candidates are not permitted.
In those cases where a slate of electors is not required, the state must necessarily have a means for appointing the electors.
The summary provides the statutes that apply in the various states.
For the State of Alabama (mentioned in a comment), candidates appearing on the ballot must supply the names of electors to "the Secretary of State no later than the 82nd day next preceding the day fixed for the election." (Section 17-14-31) However, write-in candidates cannot supply those names at that time.
In Section 17-14-34, the Governor "must certify the returns, ascertain which electors are elected, and notify them by proclamation."
Should write-in candidates (for the office of President and Vice President) succeed, then electors need to be chosen and their names sent to the Secretary of State (the 82nd day requirement does not apply). The Governor can then complete Sec. 17-14-34 as required by law.
While the law does not spell out what must happen in the case of a successful write-in campaign, it is, nonetheless, clear that the names of electors must be submitted post-election; otherwise, there would be no vote for the state at the meeting of the electoral college.