To embed a trailer on a website, the coder uploaded the trailer to Vimeo and copied the embed code. They customized the embed options to autoplay the video and adjust the size. The coder then added the trailer to Dreamweaver, entered CSS code to position the trailer on the right side of the page, and adjusted the width and height values to fit the website layout.