I have a bladder infection what can I do to get rid of the bladder infection without going to the doctor because I can't afford it

Antibiotics. Unfortunately, you really must have a urine test & prescription antibiotics to appropriately treat your uti. Without it, the infection could linger and even worsen to affect your kidneys. I understand that medical care is expensive, but a hospital admission would be much worse. Seek out county hospitals, free clinics or a planned parenthood in your area. They can help and possibly reduce the cost.