can someone please help me do something on my end to prevent high ping in games? Typically, I either get a ping of 30-50 OR 350-990 for the entire game. Why is it great sometimes and unplayable at other times? What can I do to prevent being added to a game where I have 1 second lag between my actions and results?

FYI, I have great internet and a top notch computer. I am sure it is not on my end. I am convinced I am being added to servers that are far away from me.