What makes you so certain that it is not being caused by your memory cards? Do you format cards in the camera?
What brand of cards are you using? Stick to major name brands, 32 GB or smaller. Do not use micro-SD cards with the adapters because they will always eventually fail.
I have formatted the cards numerous times and i only format in the camera. And no i am not using anything other than SD cards one is 16GB and the other is 32GB and they're both major name brands and i haven't used any other type of card. So yes i'm sure the problem isn't from the SD cards.
Okay. You use "major brand names." Some models are not suitable. For example, the U1 or UHS-II cards are not suitable.
" ... ... it just stops working and the photo number starts blinking.?
What is the value of the number that is blinking? The type of behavior is not described in the User Manuals. Where do you see this? Rear LCD during image preview?
"But i used those same SD cards for 2 and a half years before it started acting this way if it weren't suitable for the camera i think i would've faced this problem right from the beginning."
There are two ways to look at it. Your experience is either very good luck, or very bad luck. Pessimists and optimists disagree.
You really have not answered my most important questions. If you cannot provide clear answers to my questions, then I will not be able to help you. For example, you have yet to state what make and model memory card yo hare using. Good Luck.
The very simple solution is to buy a new SD card. SD cards can develop bad sectors. A change in file format during data transfer can corrupt it. You can try formatting your SD cards on a Windows machine, not a Mac, and see if it corrects it. But I would toss these and buy brand new high quality SD cards that are recommended in your cameras manual.
BTW, many cheap memory cards on eBay tend to be fake. They look fine but cause all kinds of read/write errors when you try to use them. Be careful buying from Amazon, too.