My general approach is: if I recognize that it is something I signed up for, I usually use the unsubscribe link (either in the email client or the email footer). If I get another email from them after about a week, I mark that as spam.
Same idea with text messages. If I know why I’m getting it, I use the “reply STOP” feature.
If I don’t recognize the sender of an email or text, I mark it as spam or junk. Apple Messages has a nice “delete and report as junk” feature for unwanted text messages.