A class of optimal three-weight $[q^k-1,k+1,q^{k-1}(q-1)-1]$ cyclic codes over $\bbbf_q$, with $k\geq2$, achieving the Griesmer bound, was presented by Heng and Yue [IEEE Trans. Inf. Theory, 62(8) (2016) 4501-4513]. In this paper we study some of the subfield codes of this class of optimal cyclic codes when $k=2$. The weight distributions of the subfield codes are settled. It turns out that some of these codes are optimal and others have the best known parameters. The duals of the subfield codes are also investigated and found to be almost optimal with respect to the sphere-packing bound. In addition, the covering structure for the studied subfield codes is determined. Some of these codes are found to have the important property that any nonzero codeword is minimal, which is a desirable property that is useful in the design of a secret sharing scheme based on a linear code. Moreover, a specific example of a secret sharing scheme based on one of these subfield codes is given. Finally, a class of optimal two-weight linear codes over $\bbbf_q$, achieving the Griesmer bound, whose duals are almost optimal with respect to the sphere-packing bound is presented. Through a different approach, this class of optimal two-weight linear codes was reported very recently by Heng [IEEE Trans. Inf. Theory, 69(2) (2023) 978–994]. Furthermore, it is shown that these optimal codes can be used to construct strongly regular graphs.