If an extraterrestrial race were to send a signal to earth containing a virus (technological or psychological), how could that signal then infect our technology and then be received by humans?
They are sending (trading? donating?) scientific information. The first is a blueprint for a fusion reactor. People are suspicious, they analyse it, they understand it, and it works. The second is the algorithm to maximize advertising revenue for your social media platform while keeping hate speech away. People look at it, they cannot quite grasp why it works, but they use it anyway. Then, when the suspicion dies down, they send the DNA of a microbe which solves global warming with absolutely no side effects. Guess how that one works out.
Then there is the kind of "virus" that is called a meme. I mention Last Christmas and some readers won't be able to get it out of their mind for the rest of the day, even in February.
Where a physical virus hijacks cells of the host body to replicate itself, a meme hijacks thought processes to replicate itself.
A technological virus is out of question for nowadays, unless they hack into the internet in a way that only works in Hollywood.
However, if this were done in the 70's or 80's it might just work! Back then a lot of computer programs were stored in cassete tapes, the type you would use in a stereo (floppies were a thing, but hadn't dominated the market yet). Some programs were broadcast by radio stations. All you had to do was putting your stereo in record mode while tuned to the station at the right time to download it. This was usually done by/in/for university engineering courses, and government it professionals handling data. It was less cumbersome than most alternatives.
All the aliens would need to do was sending a strong AM/FM signal with some malware at the right frequency and modulation and at the right time. Granted, the damage they could do would be limited to bad data processing, but still, that would be fun to watch.
Or, if your story is set in the early 2000's, you could keep some people from watching satellite TV.
As for a "psychological virus", it has been done before. By us. Just spread rumors that vaccines cause autism, GMO's cause cancer and that condoms don't reduce the chance of HIV transmission. A lot of people will believe, and that will cause as many deaths as wars do. Just broadcast it in AM/FM.
Perhaps just sending certain data encoded into the virus RNA might be sufficient to cause mayhem. Assuming that the virus arrived in some way that made it obvious that it was of extra terrestrial origin and that Terrestrial scientists were then asked to study it and discover its contents reading the code could potentially be very disruptive.
Step one would be realisation that we are not alone which of itself might be unsettling. Step two might be the discovery that the virus actually contained a message and was not just an alien life form.
Step three might be decoding that message in stages some parts deliberately harder than others initially some new physics perhaps or some other item of high technology proving that the message was not a fake.
Then time for the religious message asserting that the messiah would rise again but the infidels had to be destroyed first and that anyone who did not believe in Christianity or Islam was an enemy.
Obviously the message would have to be more subtle that that, but with billions of characters to play with and an advanced alien intelligence it might be possible. Ideally and most likely that data in the code would be widely disseminated for deciphering so would not be easily suppressed when the translations started to come up with disruptive and dangerous content.
a virus (technological or psychological), how could that signal then infect our technology and then be received by humans?
The realistic answer is that it couldn't. It is hard enough to communicate, let alone abuse the communication as in, say, The Astronaut's Wife.
In A for Andromeda, thanks to their extensive knowledge, the aliens send several alternative designs covering all reasonable possibilities for a biochemistry, allowing Earthmen to build from the bottom up a self-improving system that then further leverages the information available until it is able to replicate a human being
and, yes, a plague too.
In Factoring Humanity and Golden Fleece (both by Robert J. Sawyer) some information is transmitted that has interesting and hand-waved "universal" properties - it will act on a human mind, or on a computer in the second novel, whatever its ultimate nature and development because it plugs into some universally shared trait by either biological sentiences or computer systems.
In other words, there is only (almost) only one fundamental way for computer programs to function (RAM, ROM, binary code and CPU organization plus the technological way to realize all of that, at least past a certain technological level) and there is (almost) only one fundamental way for sentience to function. Plus that fundamental way is flawed in some way or other. So, by abusing that underlying common level, you can force the computer or sentience to do your bidding.
Now yes, assuming that such ultimate traits do exist and the aliens are aware of them, then they might exploit them somehow. For example some joke so good or some concept so stimulating that anyone coming across it (except somehow the aliens, which might be the exception to that 'almost'?) cannot but laugh themselves to death or freeze and stare at their collective navels. This is not a novel concept, since it's referred to in the Comedìa by Dante (XIVth century) (Paradise XXXIII: "Such in that Light doth one at last become / that one can never possibly consent / to turn therefrom for any other sight"): once you see God, you cannot look to anything else because you no longer want to.
The same could happen, intentionally or not, for some kind of ideas - they are known as memetic infections. Something the target species somehow never came round to thinking, and yet so enticing that they can't stop themselves from enacting as soon as they are made to think of it - and that can have self-reproducing qualities; for example a really convincing evangelic religion. A race hit by that (or particularly sensitive to it) would dedicate vast resources to the endeavour of retransmitting the same "infection" to the whole Universe.
Something of that kind sort of tries to happen in David Brin's Existence, where umpteen alien races
start sending us unsolicited sentient chain emails .