Favor and favour are two spellings of the same noun or verb. The spelling depends on the type of English.
In American English, you use “do me a favor.”
In British English, you use “do me a favour.”
The same distinction applies to similar words, such as “honor or honour,” “labor or labour,” “favorite or favourite,” “behavior or behaviour,” “color or colour,” and “humor or humour.”
A QuillBot grammar check can help ensure you’re using either American or British English consistently.