My phone doesn't work, what can I do?

I brought a new phone + contract Three weeks ago. It's a refurbished iPhone 8. When I first set it all up it was okay, had no problems with it whatsoever. A couple days later and it starts telling me I have no service so I couldn't use it unless at was connected to Wi-Fi. About two weeks later after the first bill went out, it started working fine again. 4 days later and once again it keeps telling me I have no service. The SIM card is definitely in the right way. I've even swapped the new sim out for the old one I had and still had the same problem. It only ever says it's searching for a signal or there's no service at all.
Is there anything I can do myself to solve the problem and fix it? I've recently changed jobs and don't get paid until next month so to pay for it to be fixed is out of the question really. I can't afford to but I don't particularly want to be out of a phone and unable to contact people if I need to as my old contract gets cut off on the 24th.
Any ideas what could be wrong with it?

You need to take it back to the store. It sounds as though the pis that connect to the SIM card are no longer making good contact - probably why it was traded in!

Take it back to where you bought it from.