As others have said , check your pressures. It’s not a difficult job to check them yourself with a manifold gauge and hose set. Eric’s has good video’s on AC systems.
My two cents … I had a 95 Honda Accord and then a 2000 Jeep Wrangler that both had the symptom of the AC working for a few minutes then not, then working, then not. A repair shop told me I needed a new compressor each time ($$). These were old cars, and honestly, I don’t use AC that much in the Jeep anyway. With a little research, I found that compressors have electro-magnetic clutches and the gap can become too wide for the magnetic field to operate consistently. The good news is that you can remove a shim to get it working successfully (I was able to do this on both vehicles without disconnecting any lines). Check a shop manual for your vehicle to find the correct gap.