Open the Macro Editor by going to Macro / New Macro Editor or use the shortcut NM . You can now either start typing your macro into the editor or copy and paste a macro from the Macros Forum. Click on the Green Play Button to try running it and on the Save Button to save the macro on your computer. You can specify the path where you want to save your macros in your Preferences: go to File / Preferences (shortcut Ctrl/Cmd+,) and change your Macro Path to a directory of your choice.
You can specify your own shortcut to run a macro (rather than having to open it in the Macro Editor and click on Play every time!). Go to Macro / Define Macro Shortcuts... (or type DU) or click on the Shortcut Button in the Macro Editor. The keyboard shortcuts Q0-Q9, W0-W9 and Y0-Y9 are reserved for user macros. Simply select the shortcut you would like to use and select your macro using the Gear Icon, click Save and Close and your new shortcut should work.