See if your doctor can refer you to physical therapy. It sounds like you have occipital neuralgia (I do also), even though this is a nerve issue, it can be aggravated by muscle spasm and trigger points. PTs can try stretches to soothe the muscles, ice to reduce inflammation, TENs to confuse the pain processing pathways, exercises to strengthen supporting muscles and thus improve posture and reduce spasm, massage to directly reduce spasm (assuming you have some, most modern people do. If you use cell phones/computers you probably do), and other techniques. Some people find that weekly acupuncture can reduce the pain by distracting the nervous system (similar to TENs). Ice helps me sometimes, but can make it worse others. Diclofenac gel can help a little; it is basically topical ibuprofen marketed for arthritis. I find if I layer it on thickly it reduces the pain slightly after a few hours. Topical cbd and thc can similarly help. With all of these typical agents there may be some rebound if you use them too much.
My guess is stretches and ice will end up working the best for you, but medicine is just so personal that it is hard to say.
Note that pain processing is subject to mind over matter processing too and so I find that acceptance and commitment therapy techniques can help too. For example: 'I notice that there is (severe/moderate) pain in my neck. I notice also anger and irritation because of that. These things are trying to protect me, but I know there is no injury to protect. I accept the pain gratefully and release it.' For me this helps a lot on days that I can powerful, but it consumes willpower and so does pain, so sometimes it's just straight up impossible.
Also, sometimes you just gotta take 600mg of ibuprofen and 1000mg of acetaminophen with a cup of green tea and sit with an ice pack on your neck and just hate the pain for a while. That's ok too.
I think I may have been writing this message to myself as much as you. Note, I'm a fourth year medical student in California and a former research scientist for a decade who has been struggling with severe migraine since age 8, chronic migraine since age 25, and occipital neuralgia since she 30. I'm 36 now. My advice is a mix of my own experience and my considerable medical knowledge on this topic. It's not official medical advice though, because I haven't spoken to you, so I really have no idea which of the things above will work for you, if you can even take any of the meds I mentioned, etc. It might be a good idea to try and find a primary care doc or PT who knows a lot of this stuff and can help you.
Good luck! ♥️