Clear["Global`*"]

Alyssa’s code:

f[r_]:=(((r/12)(87750))/(1-(((1+r/12))^(-180))))-980.96
a=.1025
b=.2
Plot[f[x],{x,a,b}]
fa=f[a]; fb=f[b];
fa
fb
c=a+.5*(b-a)
While[a < c && c < b,
fc=f[c];
If[Sign[fc]==Sign[fa],a=c;fa=fc,b=c;fb=fc];
c=a+.5*(b-a)]
c

Some comments by Andy:

You can always check your code with a known function:

f[x_]:=x^2-2 (* Should be the Sqrt[2]: *)
a=1
b=2
c=a+.5*(b-a)
Plot[f[x],{x,a,b}]
fa=f[a]
fb=f[b]
While[a < c && c < b,
fc=f[c];
If[Sign[fc]==Sign[fa],a=c;fa=fc,b=c;fb=fc];
c=a+.5*(b-a);
]
c

FindRoot[f[x],{x,1}]

Now let’s try that other function:

You can always check your code with a known function:

f[x_] := x*Exp[-x] - 0.16064
a=0
b=1
c=a+.5*(b-a)
Plot[f[x],{x,a,b}]
fa=f[a]
fb=f[b]

While[a < c && c < b,
fc=f[c];
If[Sign[fc]==Sign[fa],a=c;fa=fc,b=c;fb=fc];
c=a+.5*(b-a);
]
c

FindRoot[f[x],{x,.3}]