Why does the outlet work for a washer, but not a light fixture?
Is this a duplex outlet, and if so are you using the same socket ?

If the light works anywhere, the light works.

The difference is something in the outlet. The good answer would be that the outlet is no longer tight enough to make good contact with the lamp plug.

Try squeezing the pins on the plug of the lamp, and then putting it back in the washer socket.

The bad answer is that there is something in the socket or wiring that have too much resistance to allow the small current draw of the lamp, but will let the big current of the washer to go through.

A test would be to plug a toaster, hair dryer or electric heater into the washer socket and see if it works.

If the if any of those work, and the lamp does not, there is a serious problem in the wiring.

It is likely the outlet or the wires right where they attach to the outlet. But you will need repair by someone that can find and fix the problem.