How can I prevent text messages going to my Mac?

  1. Open Messages.app from the Applications folder, or Spotlight (⌘-space).

  2. Open the Preferences window from Messages → Preferences or press ⌘,

  3. Select the Accounts tab.

  4. Select your iCloud account and uncheck the Enable this account option.