Question: how to link my iphone messages to my mac?
Answer: Open Messages.
Click Messages -> Preferences.
Click the "Accounts" tab in the top.
Select your iMessage/Apple ID account, and make sure "Enable this account" is checked.
Select your phone number and any email address(es) that you would like synced.