try + to infinitive or -ing
So Don called up his friend Peter, who worked about four or five days a week, and asked if he could go to Peter's gym with him. Off they went, and Don tried everything. He tried taking an aerobics class. Nope, he didn't like the music. He tried swimming. Nope, it irritated his eyes. He tried spinning, but that just seemed like a thing for crazy people. He tried running on the treadmill, but he got really bored and the headphones on his mp3 player kept falling out of his ears.
There was only one thing left to do: he would have to try weight-lifting. He went over to where Peter was working out and tried to pick up a 75-kilo barbell. Nope! It was impossible. He couldn't even get it off the ground. He tried to lift 50 kilos, but he couldn't do that, either. Peter told him to try starting with a much lower weight, something like 15 kilos. Don could just do that, but he was a bit embarrassed by how weak he was and didn't want to try to do 15 repetitions in front of Peter. Besides, by this time he was so tired all he wanted to do was go home and take a nap. Not a very successful visit!
With these examples, you may have figured out that the basic difference is between an activity which is difficult or requires a lot of effort, and an activity which you are doing for the first time or testing to see if it will work as a solution.
try + -ing (seeing if it works for you/testing)
Don wants to get fit. He doesn't know the best way to do this, so he tries a lot of new things: taking an aerobics class, swimming, spinning, runing on the treadmill. These were new things that he'd never done before, but that he was sampling. When he's having trouble with the weight lifting, Peter makes a suggestion of a possible solution: try starting with a much lower weight.
try + to infinitive (doing something difficult)
When he tried lifting weights, he found that some of them were just too difficult for him: he tried to lift a 75-kilo barbell and couldn't, the same happened when he tried to pick up 50 kilos. By this time he was so embarrassed and tired that he didn't want to try to do 15 repetitions with the 15-kilo weights.
This sentence might help you remember the difference: When we're trying to solve a problem, something which requires effort, we'll often try doing different a variety of things in order to find a solution. Another thing that might help you is to remember that the -ing form often works like a noun, grammatically speaking. So if you try weight-lifting, it's the same as saying you try lifting weights.