This guide will showcase how to create a data pack that adds a custom structure to the world. There is also a data pack download of this complete example.
Always leave the world and rejoin to apply the new changes!
Updates for both 1.18.2 and 1.19 can be found at https://misode.github.io/guides/adding-custom-structures/