I've never tried meth but I take prescribed amphetamines semi-daily and I used to get this issue occasionally with Adderall XR (Which is one of the reasons that I switched to Dexedrine IR, along with it just working better for me.)
Weed is a great way to deal with this. My go-to is a vape or full spectrum oil tincture that has approximately a 1:1 mix of CBD:THC. Dry herb vapes are great too. I haven't really been using THC at all the past few months because it can hurt my productivity, but it's still my go-to if I get anxiety surrounding sex and/or the amps are fucking with my sex drive.
Doing kegel exercises (yes, they're for men too) and even just a bit of stretching 5-10 minutes before sex can also help restore blood flow and chill you out a bit. I can't say that I know what I'm doing in this area, but when I've tried it it seemed to help.
Three often overlooked causes of ED that are especially common for stim users: Sleep deprivation (The biggest obstacle by far from my experience), dehydration (very easy and quick to fix), and not eating (also very easy to fix.)
Here's how I learned that the hard way. When I was 17, I had a morning where I'd slept like shit, hadn't eaten for a full day or so, and had gone to a girl's house to hook up with her. Even though I was into her, I couldn't really get in the mood because my body was so distracted by being hungry and my dick kept going soft. I don't think I was even on Adderall that day, I was just that hungry (maybe because I'd worked out that morning?) There was definitely some anxiety involved too because this was also only the second person I had fucked (right after I got out of a bad long-term-relationship with the girl I lost my virginity to.) I stopped things after a few minutes and we went to her kitchen and I ate some cereal and a pack of raspberries or some shit. My dick instantly started working great after that, but she ended up having to sneak me out of her house a half hour or so later because her brother came home. Moral of the story: Take care of your body if you don't want to break your dick.
Side note on weed: Don't get the shitty black market vapes that land people in the hospital. If you have any sort of mental illness/pain issues/etc, scripts are very easy to get in some places (usually those with legalized cannabis) and will generally give you access to better quality products for lower prices. Go to a standard dispensary if cannabis is legal and you can't get a script. If cannabis is a grey area/illegal but unenforced where you live, try a grey market dispensary - online or offline works. I generally would rank quality for vapes as: Medical > Dispensary > Grey Market > Black Market. If you're just buying bud, it can be a completely different story and the medical weed and/or the grey/black market bud may be far better than a lot of the legal flower - and much cheaper. But whatever you do, do not get the shitty black market vapes. I know people who temporarily fucked up their lungs for weeks from a single disposable vape cart - always from the same local drug dealer.