You mean all the wedding guests don't get to spend the night in the castle? LOL.
According to Rome2Rio, there is hourly bus service from Edinburgh's Waverley Station. This is the X95 bus, operated by Borders Bus. If I'm reading the information correctly, there's still a bit of a walk once you get off the bus so you may need to arrange a taxi or Uber to get to and from the door of the castle. https://www.rome2rio.com/map/Edinburgh-Waverley-Station/Borthwick-Castle
Depending on what time of day/evening the wedding is expected to end, you'll want to double-check the schedule so as to catch a bus to get back to Edinburgh.