One day i was cleaning my trumpet's third valve. when i tried pressing the key it was goig inok but near the end it gets stuck and gets unstuck like a second later.how can i fix this problem with out spending too much money?
That sounds like a ping in the valve casing which, if let go , can ruin the valve. It's a repairshop item maybe $100
instead of the standard cheapo trumpet grease, try a more generic brass instrument oil. also make sure you aren't tightening the valve screw cap too tightly. it's not a good idea just keep tapping it. also, unwanted moisture can create a seal that will sometimes inhibit the valve from popping back up. get it dried out as much as you can. also, don't use too much of anything - the oil, the grease, etc - excess will keep it from popping out too.
clean the valve and the tube the valve fits in. You will need to take the bottom cap off and with valve oil on a soft cloth (t shirt) wipe out the inside completely wipe down the valve with the cloth also. Clean the spring that pushes the valve back up. Use a tiny bit of vaseline and a liberal amount of valve oil on the valve. Replace everything. If this doesn't do it, take it to the repair shop.