Creating a pseudo load

I’m trying to create a pseudo load to keep an existing electronic control module happy when I switch an external input.

The electronic control usually controls a solenoid with a 5ohm resistance.
I’ve tried to switch it to a 5ohm wire wound resistor but it gets very hot very quickly.

How can I replicate the solenoid?

what wattage is the resistor rated? What voltage are you dealing with?

its a 5W resistor and a 5V circuit.

You are expecting a 5 watt resistor to dissipate its ABSOLUTE MAXIMUM amount of heat, 5 watts. Expect it to get hot!