Painting engine in engine bay?
Ethan, It’s not a dumb post or question.
If you have access to a good pressure washer like a heated one, clean it the best you can. Even a car wash will work just not as well.
Spray it down with a degreaser first.
Protect the items you don’t want painted and go for it. It will most likely look better afterwards than now but, we need photos before and after.
Enjoy cleaning it up.