My hazards only work when the engine is off. Turn signals work properly when engine is on, but the hazards only work if the engine is off.
Are you stepping on the brake when the engine is running?
No, had it in park.
what year model?
That is a very strange issue. I can only think there may be a grounding problem with the emergency flasher unit or a problem with the alternator. To see if it a ground issue you could try running a temporary ground jumper from the battery to the dash area to see if that changes things. I doubt the alternator is causing this issue but to see if it is you could disconnect the plug on the back side of the alternator then start the engine and see if that makes a difference on the flashers.
I don’t know how the brake lights are wired on a Ford F-150. If the brake lights are wired through the ignition switch so that the brake lights only operate when the igniton is on, the problem might be in the braked light switch. I think the hazzard lights use the same filament as the brake lights. If the brake lights are stuck on, the hazzard lights probably wouldn’t work. You might start by making certain that the brake lights are functioning as they should.
Did they ever work before? I think some model cars were designed that way. I used to own a car that would shut them off as soon as you shifted into gear. You couldn’t drive with them on.