In the smart city paradigm, the deployment of Internet of Things (IoT) services and solutions requires extensive communication and computing resources to place and process IoT applications in real time, which consumes a lot of energy and increases operational costs. Usually, IoT applications are placed in the cloud to provide high-quality services and scalable resources. However, the existing cloud-based approach should consider the above constraints to efficiently place and process IoT applications. In this paper, an efficient optimization approach for placing IoT applications in a multi-layer fog-cloud environment is proposed using a mathematical model (Mixed-Integer Linear Programming (MILP)). This approach takes into account IoT application requirements, available resource capacities, and geographical locations of servers, which would help optimize IoT application placement decisions, considering multiple objectives such as data transmission, power consumption, and cost. Simulation experiments were conducted with various IoT applications (e.g., augmented reality, infotainment, healthcare, and compute-intensive) to simulate realistic scenarios. The results showed that the proposed approach outperformed the existing cloud-based approach in terms of reducing data transmission by 64% and the associated processing and networking power consumption costs by up to 78%. Finally, a heuristic approach was developed to validate and imitate the presented approach. It showed comparable outcomes to the proposed model, with the gap between them reach to a maximum of 5.4% of the total power consumption.