Removing elements is not quite variation but it is a very good technique. If I have a really busy melody/arp/progression, I'll cut out some notes and use the reduced versions in the leadup to foreshadow the full element.
Call and response is a classic. If you have 2 or 4 bars you can make it the call (part A) and then add something new for 2/4 bars as the response (part B). You then have the option of keeping A relatively static, and adding variation to part B. Because A will act as an ostinato, grounding the listener back in the motif with each call, you can sometimes make each B drastically different from each other and it will still work.
It also helps to know your theory, so you know why what you wrote works the way it does. From there you can make tweaks - you might have one melody pulling from 7th chords and another iteration of it based on major triads, or you might have your cadence resolve to a V here and a I there, or prevent it from resolving after 4 bars and then repeating it to resolve at 8 bars (doubling the length of the element).
More and more what I've learned, is that music production is work - and that slamming your head against the keyboard isn't a bad thing, it's what you're committing yourself to when you sit down to write a new song. But then you get the elements in place and everything feels magical and you forget how rough the start was. So sometimes you might just have to start manually and randomly wiggling notes around, and that is a legitimate part of the process.
One last thing, if you have 8 bars of melody or rhythm and need another 8 that matches it, try to work out the core elements of the original 8 - where does the beat fall, rests, where are the accents, which notes are just filler, etc. Note where upward/downward runs start/stop. Particularly the accents and rests. And then write your second 8 bars listening to the just the rhythm of the accents or something else super barebones like that. You can entirely copy where the accents and things are, or you might selectively change them for effect. But keeping those core elements like accents and rests in place will help the second 8 sound like it belongs with the first 8.