How to make sure that a conference is not a scam when you are invited as a speaker?
[As per suggestion of user151413, comment converted into response]
A few sanity checks to run:
Ask them who else is in your session and with which topics, if possible.
Check the participant list or the confirmed speakers. I know established researchers that had been taken in by junk conferences. If a junk conference manages to get a lot of good speakers, though, it ceases to be a junk conference :-) Of course, they may lie, but that is usually less likely. If you know one of the other invitees, you could pop them a mail and ask them whether they go.
Check the topics. Does this look like there is a proper scientific agenda or just a jumble of buzzwords? Are the sessions organized by topic (more or less)?
Is there a program committee? Do you know anyone on this list (even just as an author, not personally)? How many?
If you know a person on the PC, 5a) ask them whether the conference is worthwhile (you may thereby find out on the fly whether they actually know that they are listed). 5b) If you don't, check whether the conference is listed on their CV if it is public.
Unfortunately, the often-cited killer criterion whether the conference is at an attractive place does not mean anything. Also good conferences like attractive locations. However, if the conference is running at a nice location while a pandemic situation is still going on, this is most definitely a red flag.
If they claim you are invited, find out whether they cover travel/accommodation and conference fees. If they tell you that you have to pay conference fees, this is a scam. If they say that the conference is free, but they do not cover the trip, it's an orange flag (but not necessarily a scam). Convince yourself that the expense of the trip would be worth your presence. Some high-tier conferences waive only the fees for "minor" invited speakers (e.g. speakers invited to special sessions or workshops, rather than all-out keynotes). For a keynote, you can expect to be fully reimbursed.
Note that sometimes sconferences (scam conferences) adopt names very similar to proper ones, sometimes even copying the precise abbreviation (which unfortunately is not protected, as a number of organisations share the same abbreviation). Some years ago, a sconference hijacked the abbreviation of a quite high-profile conference, located itself in a city in the same or nearby country (I forgot), showed similar-style entry page/photo and managed to convince the search engines for a period to put it on top of the search list. A colleague almost fell for it, but was wondering why all his usual colleagues would not appear.
So the list of invited speakers and PC is one of the best indicators of whether this is the real deal. Of course, if they outright lie, then it's just regular fraud, but usually sconferences live in the grey area of being formally legal, in that they do take place, but are worthless.
Good luck!
[List is extended as additional suggestions are floating in comments]
If you are invited as an "invited speaker" or "honourable speaker" and the conference organizers still ask you to pay a registration fee to give your talk, that is likely a scam. The reason is that as an invited guest, you would expect some kind of preferential treatment over regular attendees. Otherwise, you are just another speaker for their conference.
Besides that, you can look at the conference website to check if the conference looks serious or not.. or if it contains some obvious problems (not always the case)? Who runs it? Is it a famous organizations like IEEE, ACM.. or is it some organizations that has a bad reputation? Has this conference been held for several years? Who are the organizers? This is just some points that you may think about to help you evaluate a conference. If you are still not sure, I recommend to ask your supervisor or colleagues about it.
How big is the conference? Has it happened before? Check your university library for proceedings of past events. If this is the first occurrence of this conference, that's a warning sign. If the proceedings of past events show similar things to your work, that's a good sign. If the previous events had several researchers close to your level, that's a good sign.
Conferences come in many sizes. There is a conference every year among 4 universities called MRST (Montreal, Rochester, Syracuse, Toronto). It's usually open to staff and grad students of those universities to present their research. So grad students, occasionally even master's students, can present. If it's like that then you probably can relax.
Some conferences get loaded up with world class folks and Nobel winners and the like. If previous versions of this conference had people like that, maybe you should be investigating more.