To modify the external margins of a heading element, you can adjust the values of the margin property. For instance, you can set the top margin to 40px, the right margin to 35px, the bottom margin to 30px, and the left margin to 35px. This allows for precise control over the spacing around the heading, enhancing its visual presentation on a website.