Messages on MacBook isn't sending or receiving messages, despite being signed in to iCloud My iPhone is connected to iCloud with the same account. In Messages → Preferences, under "You can be reached for Messages at:" my iPhone's number and my iCloud account are both there and checked.

I have tried restarting Messages, my MacBook, as well as turning iMessage off and on from my phone, and removing the files from ~/Library/Messages. Nothing so far has worked.

My computer is running El Capitan, and other applications (such as Notes) can sync over iCloud just fine.
The first step would be to make sure you can send iMessages to other iCloud users. If not, then you’ll want to Sign Out of iCloud under Messages → Preferences → Accounts. You may need to reboot your MacBook before signing back in.

If it’s regular text messages (SMS/MMS) that aren’t working, on your iPhone open Settings → Messages → Text Message Forwarding and make sure your MacBook is enabled. If it already is, toggle it off, then back on. You will be prompted to enter a verification code sent to your MacBook.

If none of this works, you may need to reboot both devices with everything disabled, then reactivate everything only after booting back up.