Assuming you have your .xlsx file open and visible in Excel, open up the VBE with Alt+F11. In the top left of the VBE is the Project Window, and you should see your file listed here. If you right-click on it, you should have an option to Insert>Module.
This will insert a standard module into the project which will now be visible on the right-hand side of the VBE (as a white window) - this is to where you need to copy and paste the code I gave you. Once the code is pasted into this window, you can use the function as you would any other formula in Excel eg select a cell and type:
=ReturnURL(A1)
Just to reiterate, you will need to save the file down as an xlsm if you don't want to copy and paste values over the UDF formulas (as .xlsx files don't support VBA code).
Richard