If you go to settings, then look under provile, choose the time contol you want to play, daily games for example. If you go to allow challenges, there's a drop box, yours is prpbably on everyone, change it to "Friends only".
How to only allow friends to challenge me?

Yes, that was on friends only by default I believe. I’ve received invites from blitz matches though, how would I fix that
how do I only let my friends challenge me? I have live chess and daily chess challenges turned to friends only by default, but people still challenge me.