?If

f[t_]=If[t<T/2,h,0];

These are rules for assigning numerical values to h and T.

r={h->3,T->1};

rh={h->3};

rt={T->1};

?RGBColor

p1=Plot[f[t]/.r,{t,0,T/.r},PlotStyle->RGBColor[1,0,0]]

w = 2 π/T /.r

c[p_] = 1/T Integrate[Exp[-I p w t]f[t],{t,0,T}]/.rt

c[1]

c[2]

c[0]

?Limit

c[0]=Limit[c[p],p->0]

Table[{n,c[n]},{n,-4,4}]//TableForm

g[t_,n_] :=  Sum[c[p]Exp[I p w t],{p,-n,n}]/.r

g[t,10]

g[t,10]//ExpToTrig

p2=Plot[g[t,10]/.r,{t,0,T/.r},PlotStyle->RGBColor[0,1,0]]

Show[p1,p2,PlotRange->All]

p2=Plot[g[t,5]/.r,{t,0,T/.r},PlotStyle->RGBColor[0,1,0]]

Show[p1,p2,PlotRange->All]

p2=Plot[g[t,20]/.r,{t,0,T/.r},PlotStyle->RGBColor[0,1,0]]

Show[p1,p2,PlotRange->All]

p2=Plot[g[t,200]/.r,{t,0,T/.r},PlotStyle->RGBColor[0,1,0]]

Show[p1,p2]

Show[p2,p1]