General strategy: Identify the noun that the relative clause refers to (in most cases the one directly in front), transform the verb of the relative clause into a participle, and put the resulting participle clause in front of the noun. It works in a similar way in English.
Ein Sonett, das aus vierzehn Zeilen besteht, ist eine lyrische Gedichtform ->
Ein aus vierzehn Zeilen bestehendes Sonett ist eine lyrische Gedichtform.
Ein Sonett ist eine Gedichtform, die aus vierzehn Zeilen besteht -> Ein Sonett ist eine aus vierzehn Zeilen bestehende Gedichtform.
(Of course the second variant makes more sense.)
In English:
A sonnet, that/which consists of fourteen lines, is a poetic form -> A sonnet consisting of fourteen lines is a poetical form.
A sonnet is a poetic form that consists of fourteen lines -> A sonnet is a poetic form consisting of fourteen lines.