Trying to install ceiling fan. There are 3 wire (black, red, white and ground). Both black and red are hot. The green one in the picture is from fan mount. The bare wire is the ground coming from the junction box.
When I connect ceiling fan's black to black and fan's white to white the fan starts once breaker is turned on.
There is one switch I assumed is for the fan and it has both black and red are hot. But it is not controlling the fan.
How should I connect the fan so I can operate it with switch?