Horned Melon Seeds can only be obtained by putting Horned Melons into a Processor.
One Horned Melon will then be processed into 2 Melon Seeds each, that can be planted on tilled land to grow into more Horned Melons - some of which can be processed into 2 Seeds and planted again...
Horned Melons can then be used in a Cooking Station together with other cooking ingredients to make Soups, Sandwiches and Pie. This Food can be consumed by player characters for a wide range of buffs (positive effects) and can also be fed to Pets.
Seeds cannot be consumed by player characters or Pets directly.
You can initially only find Horned Melons in Jungle biomes where they will grow on Detritus over time. There might not be many Melons in the game when you start playing it, but the longer you play on a game-world, the more Horned Melons will grow there.
Staying close to Jungle biomes for a while seems to raise the chances of Horned Melons to grow there.
The "Pro" world option "more regrowth" should make more Horned Melons spawn in the game-world even faster.
Horned Melons might not spawn at all on artificial Biomes made from Detritus though.
You can grow Crops like Horned Melons from Horned Melon Seeds on tilled blocks of Dirt, green Grass and/or Mud. First place such natural blocks over a body of Water or Mineral Water, or alternatively place these liquids directly adjacent to each block of Dirt, Grass or Mud (like directly below for example, or at least corner to corner).
This can even be done underground in complete darkness and/or in a building, but not at too high altitudes, not in too cold nor too hot Biomes/layers, and not too close to Swamplands or pools of Bog Water. In these cases, Seeds will stay "fallow" and won't grow (they can be picked up again though).
Next craft a Plow and use it on the solid blocks to till them; they will turn into "tilled land". Then place Seeds on the tilled land (just like you'd place any block). You can, but you do not need to fertilize Seeds in order to make your Crops grow faster.
Wait a bit until the Crops are ripe to receive the best harvest. Wheat needs approx. 50 minutes (real-life-time) to grow from seeds into ripe plants, even if you're offline. Lettuce needs about 60 minutes, Turnips not much longer (ca. 61 minutes), Horned Melons need ca. 90 minutes until they're ripe.
Crops can be harvested by being "pulled" with the gauntlet and left mouse button (by default) just like any other type of block, item, plant or liquid. If Crops stay "ripe" for 24 RL hours, they will turn into "grown" Crops. The harvest will become a little less then, but Crops won't wither.
Please refer to the article Farming if you want to learn more about growing Crops.