A novel polyoxometalate-based metal-organic compound (POMOC), namely [Ag(3-pna)2(H2PW12O40)]n (compound 1, where 3-pna = N-(pyridine-3-yl)nicotinamide), had been successfully synthesized and structurally characterized. The photocatalytic performance of compound 1 for the degradation of gentian violet (GV) and methylene blue (MB) was investigated in detail, which exhibited good cyclic stability as a photocatalyst. In addition, cyclic voltammetry technology was used to verify that compound 1 exhibited excellent electrocatalytic performance towards KBrO3 and H2O2. To improve the degradation of organic dyes and electrochemical sensing performance, a negatively charged oxygen vacancy metal oxide compound 1@C was prepared via pyrolysis using compound 1 as a precursor. Compound 1@C was investigated as an adsorbent, and was found to effectively remove MB and GV from wastewater, with adsorption rates of 824.36 mg/g and 957.02 mg/g, respectively. The performance of compound 1@C/glassy carbon electrode as an electrochemical sensor was studied using differential pulse dissolution voltammetry (DPV). This method proved effective in detecting heavy metal ions Cd2+ and Pb2+ in wastewater with the limits of detection as 4.65 and 1.69 μg/L, respectively. Compound 1@C/GCE showed good anti-interference capabilities and stability in detecting heavy metal ions in wastewater.