There are different expressions in the Holy Quran with respect to obeying the Prophet:
– It’s (Say, “Obey Allah and the Messenger.”) where we have the conjunction ‘and’ between ‘Allah’ and the ‘Messenger’ indicating that obeying Allah (swt) and the Prophet (saws) is inseparable as the Prophet states what the Almighty has sent down.
– In another position, we have: (O you who have believed, obey Allah and obey the Messenger) (of verse 59, An-Nisaa) where the Almighty separates (repeating the verb obey twice) because the Prophet )saws) is solely eligible for legislation and we have to follow (obey) him.
( فَإِن تَوَلَّوْا فَإِنَّ اللَّهَ لَا يُحِبُّ الْكَافِرِينَ … ) (…But if they turn away – then indeed, Allah does not like the disbelievers): So, Allah (swt) doesn’t like the disbelievers who deny His blessings and existence and disbelieve in Prophet Muhammad (saws). This is when they deny and turn away from obedience.