How to Disable iMessage on iPad and MacBook?
To disable Messages on iPad:

Open Settings.
Tap on Messages.
Tap and turn off iMessage to disable it.

Next, let us disable iMessage syncing your messages on your iPhone to your iPad. Again in Settings:

Tap your Name / Apple ID.
In Apple ID, tap on iCloud.
In iCloud, under 'Apps using iCloud', tap and turn off Messages.

Next, let us make sure nobody else but you can enable iMessage on iPad again. So, again in Settings:

Tap Screen Time.
In Screen Time, tap Turn On Screen Time.
Tap Continue.
Select This is My [device].
Tap Use Screen Time Passcode to create a passcode, then re-enter the passcode to confirm. (Note: This should be different from the passcode you use to unlock your iPad, and don't tell it to anyone you are sharing your iPad with. You maybe asked to enter your Apple ID and password. This can be used to reset your Screen Time passcode if you forget it.)
Now tap on Content &amp; Privacy Restrictions. (If asked, enter your passcode).
In Content &amp; Privacy Restrictions, scroll down to the section Allow Changes and tap on Account Changes.
Tap on Don't Allow.

That's it - now,

You have disabled iMessage on iPad.
Made sure that the messages you send and receive on your iPhone is not synced and available on Messages on iPad.
With Screen Time you have made sure nobody can enable iMessage again on your iPad (as long as they do not know your Screen Time passcode).


To disable Messages on your macOS:

Open Messages.
From the menu bar on top, Click on Messages &gt; Preferences...
In the Preferences window, click on iMessage.
Then click and uncheck Enable this account and Enable Messages in iCloud.
Then click on Sign Out.

On macOS Mojave:

On macOS Big Sur:

(Screenshot from Apple support docs - the id and phone number are fake).
Now Messages should be disabled on your macOS too, and unless someone knows your Apple ID and password, they won't be able to enable and access it.
(If you want to share your macbook with someone else regularly, create another user account for them. Learn how to do this here - Set up users, guests and groups on Mac).